/* KreativKlar Platform - Main Styles */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    margin: 1rem 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgb(255 96 6 / 90%) !important;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    color: rgb(255 96 6) !important;
    background: rgba(255, 96, 6, 0.15);
    transform: translateY(-1px);
}

/* Dashboard Styles */
.dashboard {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.module-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.module-card:hover::before {
    opacity: 1;
}

.module-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
}

.songwriter-module .module-icon {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.ai-guide-module .module-icon {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.website-module .module-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.image-ad-module .module-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.content-module .module-icon {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.design-module .module-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.module-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.module-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.module-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.module-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.module-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.module-btn:active {
    transform: translateY(0);
}

/* Authentication button styling */
.login-btn {
    background: rgba(34, 197, 94, 0.1) !important;
    color: rgb(34, 197, 94) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: rgba(34, 197, 94, 0.2) !important;
    color: rgb(34, 197, 94) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    transform: translateY(-1px);
}

.register-btn {
    background: rgba(59, 130, 246, 0.1) !important;
    color: rgb(59, 130, 246) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.register-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    color: rgb(59, 130, 246) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-1px);
}

.upgrade-btn {
    background: linear-gradient(135deg, #f59e0b, #f97316) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4) !important;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.quick-action:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action i {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: var(--transition);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    z-index: 1002;
    position: relative;
}

.mobile-nav-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Navigation backdrop for mobile */
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0.5rem;
        padding: 6rem 1rem 2rem 1rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        border-left: 1px solid rgba(255, 255, 255, 0.2);
        overflow-y: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
        margin-bottom: 0.5rem;
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        text-align: left;
    }
    
    .nav-link:hover {
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary-color);
        border-color: rgba(99, 102, 241, 0.2);
        transform: translateX(4px);
    }
    
    .nav-link.active {
        background: rgba(99, 102, 241, 0.15);
        color: var(--primary-color);
        border-color: rgba(99, 102, 241, 0.3);
    }
    
    /* Enhanced mobile login/register buttons */
    .nav-link.login-btn {
        background: rgba(34, 197, 94, 0.15) !important;
        color: rgb(34, 197, 94) !important;
        border: 1px solid rgba(34, 197, 94, 0.3) !important;
        font-weight: 600;
        text-align: center;
        justify-content: center;
    }
    
    .nav-link.login-btn:hover {
        background: rgba(34, 197, 94, 0.25) !important;
        color: rgb(34, 197, 94) !important;
        border-color: rgba(34, 197, 94, 0.5) !important;
        transform: translateX(0) translateY(-2px);
    }
    
    .nav-link.register-btn {
        background: rgba(59, 130, 246, 0.15) !important;
        color: rgb(59, 130, 246) !important;
        border: 1px solid rgba(59, 130, 246, 0.3) !important;
        font-weight: 600;
        text-align: center;
        justify-content: center;
    }
    
    .nav-link.register-btn:hover {
        background: rgba(59, 130, 246, 0.25) !important;
        color: rgb(59, 130, 246) !important;
        border-color: rgba(59, 130, 246, 0.5) !important;
        transform: translateX(0) translateY(-2px);
    }
    
    .nav-link.logout-btn {
        background: rgba(239, 68, 68, 0.15) !important;
        color: rgb(239, 68, 68) !important;
        border: 1px solid rgba(239, 68, 68, 0.3) !important;
        font-weight: 600;
        text-align: center;
        justify-content: center;
    }
    
    .nav-link.logout-btn:hover {
        background: rgba(239, 68, 68, 0.25) !important;
        color: rgb(239, 68, 68) !important;
        border-color: rgba(239, 68, 68, 0.5) !important;
        transform: translateX(0) translateY(-2px);
    }
    
    .nav-link.upgrade-btn {
        background: linear-gradient(135deg, #f59e0b, #f97316) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
        font-weight: 600;
        text-align: center;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .nav-link.upgrade-btn:hover {
        background: linear-gradient(135deg, #f97316, #ea580c) !important;
        color: white !important;
        transform: translateX(0) translateY(-2px);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4) !important;
    }
    
    .mobile-nav-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }
    
    .header {
        padding: 1rem;
        position: relative;
        z-index: 1000;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .logo {
        flex: 1;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-actions .actions-grid {
        grid-template-columns: 1fr;
    }
    
    /* Touch-friendly improvements for mobile */
    /* Ensure buttons are touch-friendly */
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .mobile-nav-toggle {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better spacing for mobile module cards */
    .module-card {
        margin-bottom: 1rem;
    }
    
    /* Improved text readability on mobile */
    .module-content h3 {
        line-height: 1.3;
    }
    
    .module-content p {
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .header {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .nav {
        width: 100%;
        right: -100%;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .mobile-nav-toggle {
        font-size: 1.25rem;
        padding: 0.375rem;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .demo-notice {
        font-size: 0.875rem;
        padding: 0.75rem;
        margin: 0.5rem;
    }
    
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .modules-grid {
        gap: 0.75rem;
    }
    
    .module-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .module-content h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    .module-content p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .feature-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .welcome-section h2 {
        font-size: 1.75rem;
    }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .mobile-nav-toggle {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .nav {
        padding: 2rem 1rem 1rem 1rem;
        overflow-y: auto;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
    }
    
    .dashboard {
        padding: 1rem;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}