:root {
    --bg-primary: #050511;
    --bg-secondary: #0f1021;
    --text-primary: #ffffff;
    --text-secondary: #aeb4d1;
    --accent-glow: #6366f1;
    --accent-secondary: #ec4899;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 22, 44, 0.4);
    --sidebar-width: 280px;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-2: linear-gradient(45deg, #3b82f6 0%, #06b6d4 100%);
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 16, 33, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.brand {
    padding: 10px 10px 40px;
}

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item i {
    font-size: 1.2rem;
    opacity: 0.7;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    border-left: 3px solid #6366f1;
    color: #fff;
    border-radius: 4px 12px 12px 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 60px;
    position: relative;
    overflow-y: auto;
}

/* Background Animated Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

/* Pages */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    max-width: 1100px;
    margin: 0 auto;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.page-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Cards & Containers Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Inputs */
textarea,
input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    background: rgba(5, 5, 17, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
}

textarea:focus,
input:focus {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

textarea {
    height: 250px;
    resize: none;
    line-height: 1.6;
}

/* Labels */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Prompt Page Specifics */
.prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.expiry-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 14px;
    border-radius: 12px;
}

.number-control {
    display: flex;
    align-items: center;
    background: rgba(5, 5, 17, 0.6);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.expiry-box input {
    background: transparent !important;
    border: none !important;
    width: 45px !important;
    padding: 8px 0 !important;
    text-align: center;
    font-weight: bold;
    color: var(--accent-glow) !important;
    font-size: 1rem;
    box-shadow: none !important;
    -moz-appearance: textfield;
    appearance: textfield;

}

.expiry-box input::-webkit-outer-spin-button,
.expiry-box input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    user-select: none;
}

.ctrl-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

.ctrl-btn:active {
    background: rgba(99, 102, 241, 0.4);
}


.result-overlay {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    animation: slideDown 0.5s ease;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 20px;
    border-radius: 12px;
}

.link-box a {
    color: #34d399;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.link-box a:hover {
    text-decoration: underline;
}

/* Library Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.project-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-8px);
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15), 0 0 10px rgba(99, 102, 241, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.project-prompt {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.4);
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid var(--accent-glow);
    font-style: italic;
    margin: 5px 0;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 10px;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 10px;
}

.date-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
}

.expiry-badge {
    font-size: 0.7rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.editable-badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.editable-badge:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #f87171;
    transform: scale(1.05);
}


/* Loader */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 5px;
    right: 30px;
    z-index: 9999;
}


.toast {
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 15px 25px;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}