:root {
    --bg-dark: #0a0a0f;
    --card-bg: rgba(20, 20, 30, 0.55);
    --text-primary: #f0f0f0;
    --accent: #9b87f5;
    --accent-glow: rgba(155, 135, 245, 0.4);
    --border-light: rgba(255,255,255,0.1);
    --glass-bg: rgba(18, 18, 26, 0.9);
    --neon-pink: #ff2d75;
    --neon-cyan: #00f0ff;
}

[data-theme="light"] {
    --bg-dark: #f5f3ff;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #1e1b2e;
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --border-light: rgba(0,0,0,0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="aurora"] {
    --bg-dark: #0b1120;
    --card-bg: rgba(30, 41, 59, 0.6);
    --text-primary: #e2e8f0;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --border-light: rgba(56, 189, 248, 0.2);
    --glass-bg: rgba(15, 23, 42, 0.9);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s, color 0.2s;
}

#particlesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
}

.dashboard-container {
    position: relative;
    z-index: 10;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
}

.logo-wrapper {
    text-align: center;
    margin-bottom: 1rem;
}

.fem-logo {
    font-family: 'Inter', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--accent), var(--neon-pink), var(--neon-cyan));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 8s ease infinite;
    letter-spacing: -2px;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.datetime-widget {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    display: inline-block;
    padding: 6px 18px;
    border-radius: 60px;
    margin-top: 8px;
    border: 1px solid var(--border-light);
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}

.action-btn {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-glow);
}

.category-bar {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
}

.category-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.apps-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

.quick-title {
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(120deg, #ffffff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.edit-btn {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-btn:hover {
    background: var(--accent);
    border-color: transparent;
    transform: scale(1.02);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.app-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 1.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 1px solid var(--border-light);
    box-shadow: 0 15px 35px -12px rgba(0,0,0,0.5);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent), var(--neon-pink), var(--neon-cyan), var(--accent));
    border-radius: 34px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
}

.app-card:hover::before {
    opacity: 0.7;
}

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(40, 40, 55, 0.8);
    border-color: var(--accent);
    box-shadow: 0 25px 40px -12px rgba(0,0,0,0.6), 0 0 25px var(--accent-glow);
}

.app-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
    transition: transform 0.2s;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    background: rgba(0,0,0,0.5);
    padding: 5px 16px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
}

.quote-footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    font-style: italic;
    min-height: 70px;
}

/* IFRAME OVERLAY */
.iframe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000ee;
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.iframe-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}
.close-iframe-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,80,80,0.8);
    color: white;
    padding: 14px 32px;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: 10px;
}
.close-iframe-btn:hover {
    background: #ff3b3b;
    border-color: white;
}

/* Preview Modal (NO URL) */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    z-index: 1500;
    display: none;
    justify-content: center;
    align-items: center;
}
.preview-modal-content {
    max-width: 400px;
    width: 90%;
    background: var(--glass-bg);
    border-radius: 40px;
    padding: 1.8rem;
    border: 1px solid var(--border-light);
    text-align: center;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.close-preview {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}
.preview-app-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 60px;
}
.preview-app-info img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: contain;
}
.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.preview-actions button {
    flex: 1;
    min-width: 160px;
}
.cloaked-btn {
    background: linear-gradient(135deg, #ff2d75, #ff6b6b);
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

/* Redesigned Passcode Modal (Admin Login) */
.passcode-modal-content {
    position: relative;
    max-width: 400px;
    width: 90%;
    background: var(--glass-bg);
    border-radius: 48px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 135, 245, 0.5);
    box-shadow: 0 0 30px rgba(155, 135, 245, 0.3);
    overflow: hidden;
}
.passcode-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.15;
    animation: rotate 10s linear infinite;
    z-index: 0;
}
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.passcode-inner {
    position: relative;
    z-index: 1;
}
.passcode-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.passcode-modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.passcode-modal-content p {
    opacity: 0.7;
    margin-bottom: 1.5rem;
}
.passcode-modal-content input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-light);
    border-radius: 60px;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}
.passcode-modal-content input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.passcode-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}
.passcode-hint {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* Admin modal and other modals (reused) */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(14px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}
.admin-modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(28px);
    border-radius: 40px;
    padding: 2rem;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.7rem;
}
.close-admin {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-primary);
    cursor: pointer;
}
.apps-management-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2rem;
    max-height: 320px;
    overflow-y: auto;
}
.management-item {
    background: rgba(0,0,0,0.5);
    border-radius: 24px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.app-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 2;
}
.app-info img {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    object-fit: contain;
}
.item-actions button {
    background: rgba(255,255,255,0.1);
    border: none;
    margin-left: 10px;
    padding: 8px 16px;
    border-radius: 40px;
    color: var(--text-primary);
    cursor: pointer;
}
.item-actions .delete-btn:hover { background: #c42e2e; }
.item-actions .edit-item-btn:hover { background: #3a6ea5; }
.add-app-section input, .edit-form-area input, .add-app-section select, .edit-form-area select {
    width: 100%;
    padding: 12px 16px;
    margin: 10px 0;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    color: var(--text-primary);
}
.primary-btn {
    background: linear-gradient(135deg, #6c5ce7, #a55cff);
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    color: white;
    cursor: pointer;
}
.secondary-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 10px 18px;
    border-radius: 40px;
    color: var(--text-primary);
    cursor: pointer;
}
.shortcuts-list p {
    margin: 15px 0;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
}
kbd {
    background: #1e1e2a;
    padding: 4px 8px;
    border-radius: 8px;
    font-family: monospace;
    font-weight: bold;
}
@media (max-width: 720px) {
    .dashboard-container { padding: 1rem; }
    .apps-grid { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(110px, 130px)); }
    .fem-logo { font-size: 3rem; }
}
