:root { 
    --bg: #121212; 
    --panel: #1e1e1e; 
    --accent: #007acc; 
    --accent-hover: #005f9e;
    --text: #eee; 
    --text-muted: #888;
    --border: #333;
    --danger: #a33;
}

body { 
    font-family: 'Segoe UI', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* UI Elements */
button { 
    padding: 8px 15px; 
    border: 1px solid #444; 
    cursor: pointer; 
    background: #333; 
    color: #fff; 
    border-radius: 4px; 
    font-size: 13px; 
    transition: background 0.2s;
}
button:hover { background: #444; }
button.primary { background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: var(--accent-hover); }
button.danger { background: var(--danger); border-color: var(--danger); }

input, select { 
    background: #222; 
    border: 1px solid #444; 
    color: #fff; 
    padding: 8px; 
    border-radius: 4px; 
    font-size: 13px; 
}

.hidden { display: none !important; }

/* Navigation */
header.top-bar { 
    height: 50px; 
    background: #252526; 
    border-bottom: 1px solid #000; 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
    justify-content: space-between; 
}
.brand { font-weight: bold; color: var(--accent); font-size: 18px; text-decoration: none; }
.brand span { color: #666; font-size: 11px; margin-left: 5px; }

.nav-right { display: flex; gap: 15px; align-items: center; }
.nav-link { color: #ccc; text-decoration: none; font-size: 13px; }
.nav-link:hover { color: #fff; }

/* Landing-style nav for app pages */
.landing-nav {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 10;
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav {
    background: #151515;
}

.landing-nav .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.landing-nav .nav-logo {
    color: #eee;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.2px;
}

.landing-nav .nav-links {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.landing-nav .nav-current {
    color: #aaa;
    font-size: 0.8rem;
}

.app-nav .nav-inner {
    max-width: 1200px;
    padding: 6px 20px;
}

.app-nav .nav-current {
    font-size: 0.85rem;
}

.landing-nav .nav-actions {
    display: flex;
    gap: 0.75rem;
}

.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eee;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
}

.notification-btn:hover,
.notification-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    outline: none;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53935;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    padding: 2px 6px;
    line-height: 1;
}

.notification-dropdown {
    position: absolute;
    right: 0;
    top: 36px;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 20;
}

.notification-item {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #ccc;
    cursor: pointer;
    border: 1px solid transparent;
}

.notification-item.unread {
    background: rgba(0, 122, 204, 0.1);
    border-color: rgba(0, 122, 204, 0.35);
    color: #eee;
}

.notification-item + .notification-item {
    margin-top: 6px;
}

.notification-item .notification-time {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    color: #777;
}

.notification-empty {
    padding: 12px;
    color: #777;
    font-size: 0.8rem;
}

.notification-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.notification-settings-btn {
    background: #1f1f1f;
    border: 1px solid #333;
    color: #ccc;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.notification-settings-btn:hover {
    border-color: #555;
    color: #fff;
}

.landing-nav .nav-profile {
    position: relative;
}

.landing-nav .nav-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eee;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
}

.landing-nav .nav-profile-btn:hover,
.landing-nav .nav-profile-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    outline: none;
}

.landing-nav .nav-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.landing-nav .nav-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-nav .nav-caret {
    font-size: 0.7rem;
    opacity: 0.7;
}

.landing-nav .nav-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    min-width: 180px;
    padding: 6px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0);
    transition: opacity 0.2s ease;
    z-index: 20;
}

.landing-nav .nav-dropdown a {
    display: block;
    padding: 8px 14px;
    color: #eee;
    text-decoration: none;
    font-size: 0.85rem;
}

.landing-nav .nav-dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.landing-nav .nav-profile:focus-within .nav-dropdown,
.landing-nav .nav-profile:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
}

/* Dashboard Grid */
.container { padding: 40px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-title { margin: 0; font-size: 24px; }

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.tab-button:hover {
    color: var(--text);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

#proj-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 20px; 
}

.proj-card { 
    background: var(--panel); 
    border: 1px solid var(--border); 
    border-radius: 6px; 
    overflow: hidden; 
    cursor: default; 
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex; flex-direction: column;
}
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }

.proj-thumb { 
    height: 135px; 
    background: #000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    flex-shrink: 0;
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-info { padding: 15px; }
.proj-name { font-weight: bold; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { font-size: 11px; color: var(--text-muted); }

/* Clickable areas for opening editor */
.clickable-area {
    cursor: pointer !important;
    transition: opacity 0.2s ease;
}
.clickable-area:hover {
    opacity: 0.8;
}

/* Project Action Buttons */
.proj-actions {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    position: relative;
    z-index: 5;
}

.proj-actions a.btn-action-link,
.proj-actions button.btn-action-btn {
    padding: 8px 10px;
    font-size: 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    text-decoration: none;
    color: #fff;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

.proj-actions a.btn-action-link:hover,
.proj-actions button.btn-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-analytics {
    background: linear-gradient(135deg, #007acc 0%, #0062a3 100%);
    border-color: #0088ff;
    font-size: 15px;
}

.btn-analytics:hover {
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.5);
}

.btn-preview {
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Editing mode - pulsing green */
.btn-preview.mode-edit {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border-color: #5cbf60;
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0);
    }
}

/* Testing mode - pulsing orange */
.btn-preview.mode-test {
    background: linear-gradient(135deg, #ef6c00 0%, #e65100 100%);
    border-color: #ff9800;
    animation: pulse-orange 2s ease-in-out infinite;
}

@keyframes pulse-orange {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 108, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 108, 0, 0);
    }
}

.btn-preview:hover {
    animation: none; /* Stop pulsing on hover */
}

.btn-preview.mode-edit:hover {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.btn-preview.mode-test:hover {
    box-shadow: 0 4px 12px rgba(239, 108, 0, 0.5);
}

.btn-duplicate {
    background: #2a2a2a;
    border-color: #555;
}

.btn-duplicate:hover {
    background: #3a3a3a;
    border-color: #007acc;
}

.btn-collaborate {
    background: #2a2a2a;
    border-color: #555;
}

.btn-collaborate:hover {
    background: #3a3a3a;
    border-color: #ff9800;
}

.btn-delete {
    background: #2a2a2a;
    border-color: #555;
    font-size: 15px;
    margin-left: auto; /* Push to right */
}

.btn-delete:hover {
    background: #a33;
    border-color: #a33;
}

.add-card { 
    border: 2px dashed #444; 
    background: transparent; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column;
    color: var(--accent);
    min-height: 200px;
}
.add-card:hover { border-color: var(--accent); background: rgba(0, 122, 204, 0.05); }
.add-icon { font-size: 40px; margin-bottom: 10px; }

/* Overlays */
#loader-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.9); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.box { background: var(--panel); padding: 30px; border: 1px solid #444; width: 320px; border-radius: 6px; text-align: center; }
.box-lg { width: 500px; max-height: 90vh; overflow-y: auto; text-align: left; }
.box-xl { width: 800px; max-height: 90vh; overflow-y: auto; text-align: left; }
.load-bar-bg { background:#333; height:5px; margin:10px 0; width: 100%; border-radius: 2px; }
.load-bar { height:100%; width:0%; background:var(--accent); transition: width 0.2s; border-radius: 2px; }

/* Custom Modal Dialogs */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* No background fade - user requested */
}

.custom-modal {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 30px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease-out;
}

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

.custom-modal h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #fff;
}

.custom-modal p {
    margin: 0 0 25px 0;
    color: #ccc;
    line-height: 1.5;
}

.custom-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-modal-buttons button {
    padding: 10px 20px;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.custom-modal-buttons .btn-cancel {
    background: #2a2a2a;
    color: #ccc;
}

.custom-modal-buttons .btn-cancel:hover {
    background: #3a3a3a;
    border-color: #666;
}

.custom-modal-buttons .btn-confirm {
    background: #007acc;
    color: #fff;
    border-color: #007acc;
}

.custom-modal-buttons .btn-confirm:hover {
    background: #0062a3;
}

.custom-modal-buttons .btn-danger {
    background: #a33;
    color: #fff;
    border-color: #a33;
}

.custom-modal-buttons .btn-danger:hover {
    background: #c44;
}