/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #ffffff;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --gray-medium: #e5e7eb;
    --gray-dark: #374151;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
    padding: 16px;
    background-attachment: fixed;
}

/* ===== FIXED: PASSWORD DOTS COLOR ===== */
input[type="password"] {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}

/* ===== FIXED: BETTER TEXT VISIBILITY ===== */
.app-section, .auth-card, .create-card, .note-card, .modal-content {
    background: white;
    color: #1f2937 !important;
}

/* CRITICAL FIX: Ensure all text is visible */
.note-title, 
.note-preview, 
.note-content-full, 
.user-name, 
.user-email,
.app-logo h2, 
.section-header h3, 
.empty-state h4, 
.empty-state p,
.create-card h3,
.note-card *,
.modal-body *,
input,
textarea,
select {
    color: #1f2937 !important;
}

/* White text elements */
.btn-primary,
.btn-danger,
.alert-toast,
.footer-brand h4,
.footer-info p,
.tech-tag,
.social-icons a,
.footer-bottom p {
    color: white !important;
}

/* ===== LAYOUT ===== */
.app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.app-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 85vh;
}

/* ===== AUTH SECTION ===== */
.auth-container {
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #e0e7ff 100%);
}

.brand-header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

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

.tagline {
    color: var(--gray);
    font-size: 1rem;
    font-weight: 400;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    margin: 0 auto;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    background: white;
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--gray-medium);
}

.auth-tab {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary);
    color: white !important;
    box-shadow: var(--shadow-sm);
}

.auth-tab:hover:not(.active) {
    background: var(--gray-light);
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

/* FIX: Email icon positioning - properly centered */
.form-group i:not(.toggle-password i) {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1.1rem;
    z-index: 2;
}

.form-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background: white !important;
    color: #1f2937 !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* FIX: Email hint text alignment */
.email-hint {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 4px;
    text-align: left;
    padding-left: 48px; /* Align with input text */
    display: block;
}

/* ===== FIXED: TWO PASSWORD EYE ICONS ===== */
.password-field-group {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-password:hover {
    background: var(--gray-light);
    color: var(--primary);
}

/* Ensure ALL password fields have eye icons */
#login-password,
#register-password,
#register-confirm-password {
    padding-right: 60px !important;
}

/* ===== ORIGINAL BUTTONS (KEPT AS BEFORE) ===== */
.btn-primary, .btn-secondary, .btn-danger, .btn-edit {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark) !important;
    border: 1px solid var(--gray-medium);
}

.btn-secondary:hover {
    background: var(--gray-medium);
}

.btn-danger {
    background: var(--danger);
    color: white !important;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-full {
    width: 100%;
    padding: 16px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NOTES SECTION ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-medium);
    background: white;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo i {
    font-size: 1.8rem;
    color: var(--primary);
}

.app-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937 !important;
}

.stats-badge {
    padding: 8px 16px;
    background: var(--gray-light);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #1f2937 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== USER PROFILE - ALWAYS VISIBLE ===== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    font-size: 2.2rem;
    color: var(--primary);
}

.user-info {
    display: flex !important; /* ALWAYS SHOW */
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937 !important;
    display: block;
}

.user-email {
    font-size: 0.85rem;
    color: var(--gray) !important;
    display: block;
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: #1f2937 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: var(--danger);
    color: white !important;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    padding: 24px;
    background: var(--gray-light);
    min-height: calc(85vh - 80px);
}

.create-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: 1px solid var(--gray-medium);
    box-shadow: var(--shadow-md);
}

.create-card h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #1f2937 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

#note-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#note-form input,
#note-form textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white !important;
    color: #1f2937 !important;
}

#note-form input:focus,
#note-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#note-form textarea {
    min-height: 200px;
    resize: vertical;
    max-height: 400px;
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--gray) !important;
    margin-top: 8px;
    display: none; /* Hidden as requested */
}

.char-counter.warning {
    color: var(--warning) !important;
}

.char-counter.error {
    color: var(--danger) !important;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Notes Grid */
.notes-section {
    margin-top: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #1f2937 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 10px 16px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: white;
    color: #1f2937 !important;
    cursor: pointer;
    min-width: 140px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.notes-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.notes-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.notes-loading .loading-spinner {
    border-color: var(--gray-medium);
    border-top-color: var(--primary);
    width: 40px;
    height: 40px;
}

/* ===== FIXED: BETTER NOTE CARD LAYOUT FOR LAPTOP ===== */
/* ===== FIXED: Desktop layout to match mobile (Title on top, Buttons below) ===== */
.note-card {
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-lg);
    padding: 24px; /* Increased padding for better look */
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-header {
    display: flex;
    flex-direction: column; /* Stack title and buttons vertically */
    gap: 15px; /* Space between title and buttons */
    margin-bottom: 16px;
    width: 100%;
}

.note-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937 !important;
    line-height: 1.4;
    cursor: pointer;
    width: 100%; /* Give title full width */
    word-break: break-word;
    margin-right: 0; /* Remove old margin */
}

.note-actions {
    display: flex;
    gap: 10px;
    align-self: flex-end; /* Pushes buttons to the right side */
    width: auto;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.note-title:hover {
    color: var(--primary) !important;
}

.note-preview {
    color: #374151 !important;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    min-height: 6.4em;
    word-break: break-word;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-medium);
    flex-wrap: wrap;
    gap: 8px;
}

.note-date {
    font-size: 0.85rem;
    color: var(--gray) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-length {
    font-size: 0.8rem;
    color: var(--gray) !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: #1f2937 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.view:hover {
    background: var(--primary);
    color: white !important;
}

.action-btn.edit:hover {
    background: var(--warning);
    color: white !important;
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray) !important;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-medium);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--gray-medium) !important;
    margin-bottom: 20px;
}

.empty-state h4 {
    font-size: 1.3rem;
    color: #1f2937 !important;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 1rem;
    color: var(--gray) !important;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.4rem;
    color: #1f2937 !important;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray) !important;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--gray-light);
    color: var(--danger) !important;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 50vh;
}

.modal-body p {
    color: #1f2937 !important;
}

.note-meta-view {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-medium);
    font-size: 0.9rem;
    color: var(--gray) !important;
}

.note-content-full {
    line-height: 1.6;
    font-size: 1rem;
    color: #1f2937 !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 16px;
    background: var(--gray-light);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-medium);
}

.note-content-full::-webkit-scrollbar {
    width: 8px;
}

.note-content-full::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.note-content-full::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.note-content-full::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-medium);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.delete-preview {
    background: var(--gray-light);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-style: italic;
    color: var(--gray) !important;
    border-left: 4px solid var(--danger);
}

.text-muted {
    color: var(--gray) !important;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* ===== NOTIFICATION TOAST ===== */
.alert-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--success);
    color: white !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideIn 0.3s ease;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-toast * {
    color: white !important;
}

.alert-toast.error {
    background: var(--danger);
}

.alert-toast.warning {
    background: var(--warning);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== CLEAN FOOTER ===== */
.app-footer {
    margin-top: 32px;
    text-align: center;
    padding: 30px 20px;
    background: rgba(0,0,0,0.7);
    border-radius: var(--radius-lg);
    color: white !important;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.footer-brand i {
    font-size: 1.8rem;
    color: var(--primary-light) !important;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    margin: 0;
}

.footer-tagline {
    color: rgba(255,255,255,0.8) !important;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--primary-light) !important;
    transform: translateY(-2px);
}

.footer-link i {
    font-size: 1.1rem;
}

.footer-copyright {
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-copyright p:first-child {
    margin-bottom: 8px;
}

.footer-built {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5) !important;
    margin-top: 10px;
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* General */
    body {
        padding: 12px;
        font-size: 15px;
    }
    
    .app-section {
        min-height: auto;
        border-radius: 20px;
    }
    
    /* Auth Section */
    .auth-container {
        padding: 25px 15px;
    }
    
    .logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    .auth-card {
        padding: 25px 20px;
        margin: 0 10px;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .auth-tab {
        width: 100%;
        margin-bottom: 5px;
        padding: 16px;
    }
    
    /* FIX: Email icon and other form icons on mobile */
    .form-group i:not(.toggle-password i) {
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        height: 20px;
        display: flex;
        align-items: center;
    }
    
    .form-group input {
        padding: 16px 16px 16px 48px !important;
        font-size: 16px;
    }
    
    /* FIX: Email hint text alignment on mobile */
    .email-hint {
        padding-left: 48px; /* Align with input text */
        margin-top: 8px;
        font-size: 0.75rem;
        text-align: left;
    }
    
    /* FIX: Password toggles on mobile */
    #login-password,
    #register-password,
    #register-confirm-password {
        padding-right: 60px !important;
    }
    
    .toggle-password {
        right: 12px;
        width: 42px;
        height: 42px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* Notes Section */
    .app-header {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-left {
        justify-content: space-between;
    }
    
    .app-logo h2 {
        font-size: 1.3rem;
    }
    
    .stats-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    /* User info on mobile */
    .user-profile {
        justify-content: space-between;
        padding: 10px 15px;
        background: var(--gray-light);
        border-radius: var(--radius-lg);
    }
    
    .user-info {
        display: flex !important;
        flex-direction: column;
        flex: 1;
    }
    
    .user-email {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .create-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .create-card h3 {
        font-size: 1.1rem;
    }
    
    #note-form textarea {
        min-height: 180px;
        font-size: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Notes Grid */
    .notes-section {
        margin-top: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sort-select {
        width: 100%;
        min-width: auto;
    }
    
    .notes-grid {
        gap: 15px;
    }
    
    .note-card {
        padding: 15px;
    }
    
    .note-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .note-title {
        font-size: 1.1rem;
        width: 100%;
        margin-right: 0;
    }
    
    .note-actions {
        align-self: flex-end;
        margin-top: 10px;
        margin-left: 0;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .note-preview {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        min-height: 4.8em;
        font-size: 0.9rem;
    }
    
    .note-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Empty State */
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-icon {
        font-size: 2.5rem;
    }
    
    .empty-state h4 {
        font-size: 1.1rem;
    }
    
    /* Modals */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Footer */
    .app-footer {
        padding: 25px 15px;
        margin-top: 30px;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .footer-brand {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .footer-brand h3 {
        font-size: 1.3rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .footer-link {
        font-size: 1rem;
    }
    
    .footer-copyright {
        font-size: 0.85rem;
        padding-top: 20px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .notes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-info {
        display: flex !important;
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    .notes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* FIX: Better note card layout on laptop */
    .note-header {
        align-items: flex-start;
    }
    
    .note-title {
        margin-right: 20px;
    }
    
    .note-actions {
        margin-top: 0;
        flex-shrink: 0;
    }
    
    body {
        padding: 25px;
    }
    
    .app-section {
        border-radius: 25px;
    }
    
    .footer-links {
        gap: 35px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .notes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* FIX: Even better spacing for note cards on large screens */
    .note-header {
        gap: 20px;
    }
    
    .note-title {
        margin-right: 30px;
    }
    
    .app-wrapper {
        max-width: 1300px;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
    
    .note-title {
        font-size: 1rem;
    }
    
    .note-preview {
        font-size: 0.85rem;
    }
    
    .footer-brand h3 {
        font-size: 1.2rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.message {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: #d1fae5;
    color: #065f46 !important;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b !important;
    border: 1px solid #fecaca;
}

.text-center {
    text-align: center !important;
}

.mt-3 {
    margin-top: 15px !important;
}