/* Creator AI - Apple-inspired Design */

:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --background-color: #F2F2F7;
    --surface-color: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #6D6D80;
    --border-color: #E5E5EA;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.screen {
    min-height: 100vh;
    transition: var(--transition);
}

.hidden {
    display: none !important;
}

/* Login Screen */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

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

.logo p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.value-prop {
    margin-bottom: 24px;
}

.one-thing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow);
    white-space: nowrap;
    display: block;
    width: 100%;
    letter-spacing: 0.3px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.features-preview {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
    align-items: center;
}

.feature {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    background: rgba(0, 122, 255, 0.06);
    border-radius: 6px;
    border: 1px solid rgba(0, 122, 255, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Social Sign-In Buttons */
.social-signin-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.social-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
    border-color: #d1d1d6;
}

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

.social-signin-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-signin-btn.apple {
    background: #000;
    color: white;
    border-color: #000;
}

.social-signin-btn.apple:hover {
    background: #1d1d1f;
    border-color: #1d1d1f;
}

.social-signin-btn.google {
    border-color: #dadce0;
}

.social-signin-btn.google:hover {
    border-color: #d2d4d7;
}

.btn-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    display: none;
}

.social-signin-btn.loading .btn-spinner {
    display: block;
}

.social-signin-btn.loading .btn-icon {
    display: none;
}

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

/* Trust Signals */
.trust-signals {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.trust-icon {
    font-size: 16px;
}

/* Error Message */
.error-message {
    background: var(--error-color);
    color: white;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    display: none;
    font-size: 14px;
}

.error-message.show {
    display: block;
}

/* Dashboard Screen */
#dashboard-screen {
    background: var(--background-color);
}

.dashboard-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.usage-limits {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.usage-item {
    display: flex;
    align-items: center;
}

.usage-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.usage-count.approaching-limit {
    color: #f59e0b;
}

.usage-count.at-limit {
    color: #ef4444;
}

#user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.secondary-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-button:hover {
    background: var(--border-color);
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
}

.main-content-area {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-message {
    text-align: center;
    margin-bottom: 48px;
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 32px 24px;
        margin: 16px;
        border-radius: 16px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        min-height: auto;
    }
    
    .header-left h1 {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .header-subtitle {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .user-info {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: 100%;
    }
    
    .usage-limits {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
        background: rgba(99, 102, 241, 0.08);
        border-radius: 12px;
        border: 1px solid rgba(99, 102, 241, 0.15);
        margin-bottom: 8px;
    }
    
    .usage-item {
        justify-content: center;
        padding: 6px 0;
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    }
    
    .usage-item:last-child {
        border-bottom: none;
    }
    
    .usage-count {
        font-size: 14px;
        text-align: center;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    #user-email {
        font-size: 14px;
        text-align: center;
        color: var(--text-secondary);
        padding: 12px 16px;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 10px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        margin: 8px 0;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .secondary-button {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 48px;
        font-weight: 600;
        width: 100%;
        max-width: 200px;
        align-self: center;
        margin-top: 8px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .welcome-message h2 {
        font-size: 24px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 10px 16px;
        gap: 10px;
    }
    
    .header-left h1 {
        font-size: 18px;
    }
    
    .header-subtitle {
        font-size: 12px;
    }
    
    .header-toggle-btn {
        padding: 6px 14px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .toggle-text {
        font-size: 11px;
    }
    
    .user-info {
        gap: 10px;
    }
    
    .usage-limits {
        padding: 10px;
        gap: 12px;
    }
    
    .usage-item {
        padding: 3px 0;
        padding-right: 12px;
    }
    
    .usage-count {
        font-size: 12px;
    }
    
    #user-email {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .secondary-button {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
        max-width: 160px;
    }
    
    .dashboard-content {
        padding: 16px;
    }
}

/* Mobile-specific enhancements for dashboard header */
@media (max-width: 768px) {
    .dashboard-header {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 12px 20px;
        gap: 12px;
    }
    
    /* Header Toggle Button - Show on mobile only */
    .header-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        background: rgba(0, 122, 255, 0.1);
        border: 1px solid rgba(0, 122, 255, 0.2);
        border-radius: 20px;
        color: var(--primary-color);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        width: auto;
        align-self: center;
        min-height: 36px;
    }
    
    .header-toggle-btn:hover {
        background: rgba(0, 122, 255, 0.15);
        border-color: rgba(0, 122, 255, 0.3);
        transform: translateY(-1px);
    }
    
    .header-toggle-btn:active {
        transform: scale(0.98);
    }
    
    .header-toggle-btn i {
        font-size: 14px;
        transition: transform 0.3s ease;
    }
    
    .header-toggle-btn.expanded i {
        transform: rotate(180deg);
    }
    
    .toggle-text {
        font-size: 12px;
        font-weight: 600;
    }
    
    /* User Info Section - Collapsible on mobile */
    .user-info {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        margin-top: 0;
        gap: 12px;
    }
    
    .user-info.expanded {
        max-height: 300px;
        opacity: 1;
        margin-top: 8px;
    }
    
    /* Compact Usage Limits */
    .usage-limits {
        flex-direction: row;
        gap: 16px;
        padding: 12px;
        background: rgba(99, 102, 241, 0.08);
        border-radius: 10px;
        border: 1px solid rgba(99, 102, 241, 0.15);
        margin-bottom: 0;
        justify-content: center;
    }
    
    .usage-item {
        justify-content: center;
        padding: 4px 0;
        border-bottom: none;
        border-right: 1px solid rgba(99, 102, 241, 0.1);
        padding-right: 16px;
    }
    
    .usage-item:last-child {
        border-right: none;
        padding-right: 0;
    }
    
    .usage-count {
        font-size: 13px;
        text-align: center;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
    }
    
    #user-email {
        font-size: 13px;
        text-align: center;
        color: var(--text-secondary);
        padding: 10px 14px;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        margin: 0;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .secondary-button {
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 44px;
        font-weight: 600;
        width: 100%;
        max-width: 180px;
        align-self: center;
        margin-top: 0;
    }
    
    .usage-limits {
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    }
    
    .usage-item {
        transition: background-color 0.2s ease;
    }
    
    .usage-item:hover {
        background: rgba(99, 102, 241, 0.05);
        border-radius: 6px;
    }
    
    #user-email {
        transition: all 0.2s ease;
        position: relative;
    }
    
    #user-email::before {
        content: '👤';
        margin-right: 8px;
        font-size: 16px;
    }
    
    .secondary-button {
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .secondary-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .secondary-button:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
}

/* Desktop styles - Hide toggle button and show user info always */
@media (min-width: 769px) {
    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 20px 32px;
        background: transparent;
        backdrop-filter: none;
        border-bottom: none;
        position: relative;
        top: auto;
        z-index: auto;
    }
    
    /* Hide toggle button on desktop */
    .header-toggle-btn {
        display: none;
    }
    
    /* Show user info always on desktop */
    .user-info {
        max-height: none;
        opacity: 1;
        overflow: visible;
        flex-direction: row;
        align-items: center;
        gap: 24px;
        width: auto;
        margin-top: 0;
    }
    
    /* Desktop usage limits layout */
    .usage-limits {
        flex-direction: row;
        gap: 20px;
        padding: 8px 16px;
        background: rgba(99, 102, 241, 0.08);
        border-radius: 12px;
        border: 1px solid rgba(99, 102, 241, 0.15);
        margin-bottom: 0;
        justify-content: center;
    }
    
    .usage-item {
        justify-content: center;
        padding: 4px 0;
        border-bottom: none;
        border-right: 1px solid rgba(99, 102, 241, 0.1);
        padding-right: 20px;
    }
    
    .usage-item:last-child {
        border-right: none;
        padding-right: 0;
    }
    
    .usage-count {
        font-size: 14px;
        text-align: center;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
    }
    
    #user-email {
        font-size: 14px;
        text-align: center;
        color: var(--text-secondary);
        padding: 8px 16px;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        margin: 0;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .secondary-button {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 40px;
        font-weight: 600;
        width: auto;
        max-width: none;
        align-self: center;
        margin-top: 0;
    }
}

/* Touch device improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .usage-item:active {
        background: rgba(99, 102, 241, 0.1);
    }
    
    .secondary-button:active {
        transform: scale(0.98);
    }
}