/* =========================
   BASE STYLES
========================= */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0b1a24, #1a2f3a);
    color: #eee;
    min-height: 100vh;
    margin: 0;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(79, 142, 247, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(79, 142, 247, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

h1 {
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 2.5rem;
}

label {
    color: #ccc;
    font-weight: 500;
    margin-bottom: 8px;
}

textarea {
    background: rgba(20, 25, 30, 0.9);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 14px;
    transition: all 0.2s ease;
}

textarea:focus {
    border-color: #4f8ef7;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.2);
    outline: none;
    background: rgba(25, 32, 40, 0.95);
}

/* =========================
   CARD & LAYOUT
========================= */
.card {
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 30px;
    background: rgba(25, 30, 35, 0.95);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 35px -8px rgba(0,0,0,0.5);
}

.card h4 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
}

.card h4::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #4f8ef7;
    border-radius: 4px;
    margin-right: 10px;
}

.container {
    max-width: 1400px;
    margin: 50px auto;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.app-layout {
    position: relative;
    z-index: 1;
}

.app-layout .container {
    transform: translateX(70px);
}

/* =========================
   BUTTONS
========================= */
.btn {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, #4f8ef7, #2b6ed7);
    box-shadow: 0 12px 30px -8px rgba(79,142,247,0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5e5e, #d73b3b);
    box-shadow: 0 8px 16px -4px rgba(231,76,60,0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f5b042, #f39c12);
    box-shadow: 0 8px 16px -4px rgba(243,156,18,0.3);
    color: #fff;
}

.btn-secondary-custom {
    background: rgba(79,142,247,0.12);
    border: 1px solid rgba(79,142,247,0.35);
    color: #59d2fe;
}

.btn-secondary-custom:hover {
    background: rgba(79,142,247,0.25);
    color: white;
}

.create-btn {
    margin-bottom: 20px;
    margin-top: 5px;
}

/* =========================
   MESSAGES
========================= */
.message-container {
    min-height: 54px;
    text-align: center;
}

.error-message, .success-message {
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 500;
    margin-bottom: 30px;
    text-align: center;
}

.error-message {
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.3);
    color: #ff8a8a;
    box-shadow: 0 10px 20px -10px rgba(220,53,69,0.3);
}

.success-message {
    background: rgba(40,167,69,0.15);
    border: 1px solid rgba(40,167,69,0.3);
    color: #28a745;
    box-shadow: 0 10px 20px -10px rgba(40,167,69,0.3);
    animation: slideFade 4s forwards;
    animation-delay: 2s;
}

@keyframes slideFade {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* =========================
   NUMBERS GRID
========================= */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
}

.number-item {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.35);
}

.number-item.owned {
    border-color: #59d2fe;
    color: #59d2fe;
}

.number-item.duplicate::after {
    content: attr(data-count);
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #ffc857;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 1px solid black;
}

.d-flex.justify-content-end.mt-3 {
    margin-top: 20px !important;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* =========================
   PROGRESS BARS (shared)
========================= */
.collection-progress-main,
.progress-container {
    margin-bottom: 25px;
}

.progress-header,
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.progress-header strong {
    color: #59d2fe;
    font-weight: 700;
}

.progress-track,
.progress-bar {
    height: 10px;
    width: 100%;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
}

.progress-track .progress-fill,
.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4f8ef7, #59d2fe);
    border-radius: 20px;
}

.preview-card .progress-fill {
    width: 68%;
}

/* =========================
   SIDEBAR
========================= */
.collection-sidebar {
    position: fixed;
    top: 50px;
    left: 30px;
    width: 295px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: rgba(25, 30, 35, 0.95);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 35px -8px rgba(0,0,0,0.5);
    z-index: 10;
}

.collection-sidebar h4 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.new-collection-btn {
    width: 100%;
    margin-bottom: 20px;
}

.collection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.collection-item {
    position: relative;
    width: 100%;
    text-align: left;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.collection-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.collection-item-header form:first-child {
    flex: 1;
}

.collection-select-form {
    width: 100%;
    height: 100%;
}

.collection-select {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    cursor: pointer;
    padding: 12px 16px;
}

.collection-item-header {
    width: 100%;
}

.delete-collection {
    position: absolute;
    top: 12px;
    right: 12px;

    background: transparent;
    border: none;
    padding: 4px;
    margin: 0;

    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    color: #dc3545;
    opacity: 1;
}

.delete-collection:hover {
    transform: scale(1.3);
    filter: brightness(2.4);
    opacity: 1;
}

.collection-item:hover,
.collection-item.active {
    background: rgba(79,142,247,0.15);
    border-color: rgba(79,142,247,0.4);
    color: #59d2fe;
}

.collection-progress {
    margin-top: 8px;
}

.collection-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    margin-bottom: 5px;
}

.collection-item.active .collection-progress-text {
    color: rgba(255,255,255,0.65);
}

.collection-progress-bar {
    height: 5px;
    width: 100%;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
}

.collection-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4f8ef7, #59d2fe);
    border-radius: 20px;
    opacity: 0.4;
}

.collection-item.active .collection-progress-fill {
    opacity: 1;
}

.collection-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}


.collection-tabs button {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);

    color: rgba(255,255,255,0.6);

    padding: 8px 18px;
    border-radius: 20px;

    font-weight: 600;
}


.collection-tabs button:hover,
.collection-tabs button.active {
    background: rgba(79,142,247,0.15);
    border-color: rgba(79,142,247,0.4);
    color: #59d2fe;
}

.collection-sidebar::-webkit-scrollbar {
    width: 6px;
}

.collection-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
/* =========================
   AUTH PAGES
========================= */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 35px;
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.auth-input {
    background: rgba(20,25,30,0.9);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 14px;
}

.auth-input:focus {
    background: rgba(25,32,40,0.95);
    color: white;
    border-color: #4f8ef7;
    box-shadow: 0 0 0 3px rgba(79,142,247,0.2);
    outline: none;
}

.auth-footer {
    margin-top: 15px;
    text-align: center;
    color: #aaa;
}

.auth-footer a {
    color: #59d2fe;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: #4f8ef7;
}

.demo-link {
    margin-bottom: 20px;
    text-align: center;
}

.demo-link a {
    display: block;
    padding: 7px 16px;
    font-size: 0.95rem;
    border-radius: 10px;
    background: rgba(79,142,247,0.12);
    border: 1px solid rgba(79,142,247,0.35);
    color: #59d2fe;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.demo-link a:hover {
    background: rgba(79,142,247,0.22);
    border-color: rgba(79,142,247,0.7);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================
   LANDING PAGE
========================= */
.landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.landing-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 70px;
    max-width: 1200px;
    width: 100%;
}

.landing-text {
    max-width: 450px;
}

.landing-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: white;
    margin-bottom: 25px;
}

.landing-text p {
    color: #aaa;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 300px;
}

.landing-actions .btn {
    padding: 12px 16px;
}

.preview-card {
    display: flex;
    width: 700px;
    background: rgba(25,30,35,0.95);
    border-radius: 24px;
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 25px 50px -15px rgba(0,0,0,0.6);
    transform: perspective(1200px) rotateY(-5deg);
    transition: transform 0.3s ease;
}

.preview-card:hover {
    transform: perspective(1200px) rotateY(0deg);
}

.preview-sidebar {
    width: 180px;
    padding-right: 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.preview-sidebar h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
}

.preview-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    color: #aaa;
    font-size: 0.9rem;
}

.preview-item.active {
    color: #59d2fe;
    background: rgba(79,142,247,0.15);
}

.preview-content {
    flex: 1;
    padding-left: 25px;
}

.preview-content h4 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
}

.preview-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #888;
}

.preview-stats strong {
    color: #59d2fe;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.preview-grid div {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.preview-grid .owned {
    color: #59d2fe;
    border: 1px solid #59d2fe;
}

.preview-grid .duplicate {
    color: #59d2fe;
    border: 1px solid #59d2fe;
    position: relative;
}

.preview-grid .duplicate::after {
    content: "×2";
    position: absolute;
    top: -7px;
    right: -7px;
    background: #ffc857;
    color: black;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 5px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1825px) {
    .collection-sidebar {
        position: static;
        max-width: 1300px;
        width: calc(100% - 40px);
        margin: 20px auto 50px;
        box-sizing: border-box;
    }

    .collection-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .app-layout .container {
        transform: none;
        max-width: 1400px;
        margin: 20px auto;
        padding: 0 20px;
    }
}

@media (max-width: 1100px) {
    .landing-layout {
        flex-direction: column;
    }

    .landing-text {
        text-align: center;
    }

    .landing-actions {
        margin: auto;
    }

    .preview-card {
        width: 100%;
        transform: none;
    }
}

@media (max-width: 600px) {
    .landing-container {
        padding: 20px;
    }

    .landing-text h1 {
        font-size: 2.5rem;
    }

    .preview-card {
        flex-direction: column;
    }

    .preview-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 20px;
    }

    .preview-content {
        padding-left: 0;
        padding-top: 20px;
    }
}