/* NotesApp - Modern CSS Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: var(--gray-600);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-google {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    width: 100%;
}

.btn-google:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-google svg {
    width: 18px;
    height: 18px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-desc {
    color: var(--gray-600);
    font-size: 15px;
}

/* How It Works Section */
.how-it-works {
    padding: 80px 0;
    background: var(--gray-50);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 24px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-desc {
    color: var(--gray-600);
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.divider::before {
    margin-right: 16px;
}

.divider::after {
    margin-left: 16px;
}

/* Auth Forms */
.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-600);
}

.auth-switch a {
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Dashboard */
.dashboard {
    padding: 40px 0;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-subtitle {
    color: var(--gray-600);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Setup Guide */
.setup-guide {
    margin-bottom: 32px;
}

.setup-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.setup-step {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.setup-step-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.setup-step-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setup-step-content p {
    font-size: 13px;
    color: var(--gray-600);
}

/* API Keys */
.api-keys {
    margin-bottom: 32px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.api-key-item:last-child {
    border-bottom: none;
}

.key-info {
    flex: 1;
}

.key-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.key-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.key-preview {
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.key-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 16px;
}

/* Key Display */
.key-display {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--gray-100);
    padding: 12px;
    border-radius: var(--radius);
    margin: 16px 0;
}

.key-display code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--gray-900);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background: var(--secondary);
}

.notification-error {
    background: var(--danger);
}

/* Footer */
.footer {
    padding: 40px 0;
    background: var(--gray-900);
    color: var(--gray-400);
    text-align: center;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav {
        display: none;
    }
    
    .modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .key-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .api-key-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Auth Form Styles */
.auth-form {
    text-align: center;
}

.auth-form h2 {
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.auth-switch {
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-600);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 500;
}

.auth-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    display: none;
}

.auth-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

.auth-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: block;
}

.btn-block {
    width: 100%;
}

/* Header container fix */
.header {
    position: relative;
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Auth Loading Overlay */
.auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-loading-content {
    text-align: center;
    padding: 40px;
}

.auth-loading-content h2 {
    margin-top: 24px;
    color: var(--gray-900);
    font-size: 1.5rem;
}

.auth-loading-content p {
    margin-top: 8px;
    color: var(--gray-500);
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
