:root {
    --primary: #3b82f6;
    --bg: #ffffffd0;
    --bg-2: #ffffff;
    --bg-card: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #d1d5db;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --radius: 40px;
    --logo-color: 0;
    --add-color: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-2);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    height: 100%;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    transition: all 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    filter: invert(var(--logo-color));
    transition: filter 0.3s ease;
}

.logo-text {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Search */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    transition: all 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.search-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px 12px 40px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-2);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    filter: brightness(1.2);
    border-color: #9ca3af;
}

.btn img {
    width: 16px;
    height: 16px;
    filter: invert(var(--add-color));
    transition: filter 0.3s ease;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    border: 1.8px solid transparent;
}

.avatar[style="scale: 0.5; opacity: 0; pointer-events: none;"] {
    width: 0;
    height: 0;
    filter: blur(10px);
}

.avatar:hover {
    box-shadow: 0 0 20px var(--primary);
}

/* Main Content */
main {
    position: sticky;
    top: 1px;
    overflow-y: auto;
    overflow-x: hidden;
}

.main {
    padding: 0 2rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: absolute;
    top: 100px;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
    transition: all 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.hero .btn {
    width: fit-content;
    margin-left: 15px;
    padding: 10px 16px;
    vertical-align: middle;
}

.hero img {
    filter: brightness(0.3);
    transition: all 1s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.hero-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    vertical-align: middle;
    transition: all 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.hero-title.empty {
    font-size: 1.7rem;
    border-radius: 12px;
    font-weight: 400;
}

.hero-title.loading {
    background: linear-gradient(90deg, var(--text-primary) 25%, var(--text-secondary) 50%, var(--text-primary) 75%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s infinite;
}

/* Empty State */
body:has(.empty) .hero {
    transform: translateY(30vh);
    flex-direction: column;
    gap: 20px;
}

body:has(.empty) .hero img {
    visibility: visible !important;
    opacity: 1 !important;
    height: 80px !important;
}

body:has(.empty) header {
    background-color: rgba(255, 255, 255, 0);
}

body:has(.empty) .search-container {
    max-width: 0;
}

body:has(.empty) main {
    height: 100%;
}

body:has(.empty) .search-input,
body:has(.empty) .search-icon {
    width: 0 !important;
    opacity: 0;
    visibility: hidden;
}

body:has(.empty) body,
body:has(.empty) main {
    overflow: hidden;
}

.hero:has(.empty) .edit-btn {
    display: none;
}

/* Projects Grid */
.swiper {
    width: 100%;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.swiper.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: shimmer2 2s infinite;
    filter: blur(100px);
    opacity: 0.6;
}

.swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.swiper-slide {
    width: 100% !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.swiper-slide:hover {
    border: 1px solid var(--text-primary);
    filter: drop-shadow(0 0 5px var(--text-muted));
}

.swiper-slide:active {
    filter: brightness(0.8);
    transform: scale(0.99);
}

/* Project Cards */
.project-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 50px;
    position: relative;
    background: transparent !important;
    margin: 10px;
}

.project-header.red, .project-header.blue, .project-header.purple, .project-header.green, .project-header.orange {
    background: #bdd8ff;
}

.project-icon div {
    padding: 5px;
    border-radius: 8px;
    margin-left: 5px;
    margin-top: 5px;
    max-width: 45px;
    max-height: 45px;
    scale: 0.9;
}

.project-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-content-top {
    display: flex;
    justify-content: space-between;
}

.project-title {
    max-width: 170px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;         
    text-overflow: ellipsis; 
}

.project-content-top:has(.project-hosting-status) .project-title {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-tag {
    background: var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.project-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    gap: 8px;
    transition: all 0.3s ease;
}

.project-footer button {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.1);
    transition: all 0.3s ease;
}

.project-footer.edit {
    justify-content: flex-end;
}

.project-footer.edit button {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.project-footer.edit .project-date {
    scale: 0.5;
    display: none;
}

.project-footer button:hover {
    filter: brightness(1.2);
}

.project-dlt-btn, .project-edt-btn {
    background-color: #fee2e2;
    color: #dc2626;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    border: none;
    border-radius: 40px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.project-dlt-btn:hover {
    background-color: #fecaca;
}

.project-edt-btn {
    background-color: #f3f4f6;
    color: #374151;
}

.project-edt-btn:hover {
    background-color: #e5e7eb;
}

.status-tag {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-tag.draft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.project-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 150px;
    transition: color 0.3s ease;
}

.project-hosting-status {
    scale: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
    background-color: #cdffdc;
    transition: all 0.15s;
}

.project-hosting-status:hover {
    filter: brightness(0.8);
}

.project-hosting-status:active {
    transform: scale(0.95);
}

.project-hosting-status img {
    max-width: 22px;
}

.project-hosting-status h5 {
    font-weight: 300;
    font-size: 12px;
    color: #25AF57;
}

/* Dropdown Menu */
.dropdown {
    position: sticky;
    right: 0;
    top: 100px;
    background: var(--bg-2);
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 300px;
    transform: translateY(-300px) translateX(300px);
    visibility: hidden;
    scale: 0.01;
    transition: all 0.5s cubic-bezier(0.86, 0, 0.07, 1);
    filter: blur(100px);
    z-index: 1000;
}

.dropdown.active {
    visibility: visible;
    scale: 0.9;
    transform: translateY(70px) translateX(0px);
    filter: blur(0px);
}

.dropdown-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.username {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.dropdown-menu {
    padding: 8px 0;
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.dropdown-item:hover {
    background-color: #f9fafb;
}

.dropdown-item:last-child {
    color: #dc2626;
    border-top: 1px solid var(--border);
}

.dropdown-item:last-child:hover {
    background-color: #fee2e2;
}

.dropdown-item.has-submenu::after {
    content: "›";
    font-size: 18px;
    color: var(--text-muted);
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

.submenu {
    position: absolute;
    top: 0;
    right: calc(70% + 4px);
    background: var(--bg-2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: all 0.2s ease;
    z-index: 1005;
    overflow: hidden;
}

.dropdown-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.submenu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.submenu-item:hover {
    background-color: #f9fafb;
    color: var(--text-primary);
}

.upgrade-badge {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PWA Install Popup */
.pwa-popup {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 58, 138, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px 28px;
    width: 420px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 25000;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.86, 0, 0.07, 1);
}

.pwa-popup.show-install-popup {
    display: block;
}

.pwa-popup-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pwa-icon {
    width: 48px;
    height: 48px;
    background: rgba(147, 197, 253, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-icon img {
    filter: invert(1);
}

.pwa-icon svg {
    width: 28px;
    height: 28px;
    stroke: #93c5fd;
    fill: none;
    stroke-width: 2;
}

.pwa-text-content {
    flex: 1;
    min-width: 0;
}

.pwa-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.pwa-description {
    font-size: 13px;
    color: #bfdbfe;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.pwa-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-btn {
    background: #ffffff;
    color: #1e40af;
    flex: 1;
}

.pwa-install-btn:hover {
    background: #f0f4ff;
    transform: translateY(-1px);
}

.pwa-close-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 16px;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes shimmer2 {
    0% { left: -75%; }
    100% { left: 125%; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
    z-index: 1;
}

.hero-title.empty p {
    animation: twinkle 3s infinite ease-in-out;
}

/* Utilities */
[disabled] {
    filter: brightness(0.5);
    pointer-events: none;
    cursor: not-allowed;
}

::-webkit-scrollbar {
    display: none;
}

    .btn-disc {
        border: 1.8px solid transparent; /* Width of the gradient border */
    /* 3. The Gradient Magic */
    background-image: 
        /* The Inner Background (Button Face) */
        linear-gradient(90deg, #eaefff, #e2f9ff), 
        /* The Outer Background (The Gradient Border) */
        linear-gradient(to right, #3667bc, #154676);

            /* 4. The Clipping */
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: #224c94;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0abd;
        --bg-2: #000000;
        --bg-card: #101010;
        --text-primary: #e8eaed;
        --text-secondary: #9aa0a6;
        --text-muted: #6b7280;
        --border: #5f6368;
        --shadow: 0 2px 5px 1px rgba(32,33,36,.28);
        --logo-color: 1;
        --add-color: 0;
    }

    .project-icon img {
        filter: invert(1) brightness(2) contrast(0.6);
    }

    .hero img {
        filter: brightness(1);
    }

    .btn:hover {
        background-color: #3c4043;
        border-color: #9aa0a6;
    }

    .search-input:focus {
        border-color: #9aa0a6;
        box-shadow: 0 2px 5px 1px rgba(32,33,36,.28), 0 0 0 3px rgba(255,255,255,.1);
    }

    .swiper-slide:hover {
        box-shadow: 0 2px 8px 1px rgba(32,33,36,.4);
    }

    .project-dlt-btn {
        background-color: rgba(171, 27, 27, 0.3);
        color: #ff4646;
    }

    .project-dlt-btn:hover {
        background-color: rgba(171, 27, 27, 0.4);
    }

    .project-edt-btn {
        background-color: rgba(62, 62, 62, 0.3);
        color: #e8eaed;
    }

    .project-edt-btn:hover {
        background-color: rgba(62, 62, 62, 0.5);
    }

    .dropdown {
        background: #101010;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .dropdown-item:hover {
        background-color: #3c4043;
    }

    .dropdown-item:last-child:hover {
        background-color: rgba(171, 27, 27, 0.3);
    }

    .submenu {
        background: #101010;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .submenu-item:hover {
        background-color: #3c4043;
    }

    .project-hosting-status {
        background-color: #132d1b !important;
    }

    .create-btn {
        background-color: rgb(194, 208, 255) !important;
        color: black !important;
    }

    .create-btn:hover {
        filter: brightness(0.9);
    }

    .btn-disc {

        /* 2. The Border Setup */
        border: 1.8px solid transparent; /* Width of the gradient border */

        /* 3. The Gradient Magic */
        background-image: 
            /* The Inner Background (Button Face) */
            linear-gradient(to bottom, #2c3e50, #000000), 
            /* The Outer Background (The Gradient Border) */
            linear-gradient(to right, #3667bc, #154676);
        
        /* 4. The Clipping */
        background-origin: border-box;
        background-clip: padding-box, border-box;
        color: #71a5ff;
    }
}

.create-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    overflow: hidden;
}

.add-icon {
    font-size: 18px;
}



/* Mobile Responsive */
@media (max-width: 800px) {
    .logo-text, .disc-text {
        display: none;
    }
    .btn:not(.create-btn) {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0.7rem;
    }

    .header-content {
        flex-direction: row;
        gap: 15px;
    }

    .search-container {
        width: 100%;
    }

    .project-content-top:has(.project-hosting-status) .project-title {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body:has(.empty) .logo-text {
        display: block;
    }

    .hero-title.empty {
        font-size: 1.0rem;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
        min-width: 100%;
    }

    .pwa-popup {
        top: 80px;
        padding: 20px 24px;
        width: 100%;
        max-width: calc(100vw - 24px);
    }

    .pwa-popup-content {
        gap: 12px;
    }

    .pwa-icon {
        width: 44px;
        height: 44px;
    }

    .pwa-icon svg {
        width: 24px;
        height: 24px;
    }

    .pwa-title {
        font-size: 15px;
    }

    .pwa-description {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .pwa-actions {
        gap: 8px;
    }

    .pwa-btn {
        padding: 9px 16px;
        font-size: 12px;
    }
}

.spin {
    line-height: 1;
    max-width: 16px;
    max-height: 16px;
    animation: spinit 0.8s infinite linear;
}

@keyframes spinit {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}



