/* =========================================================
   VAULT BINDER - MAIN CSS
   Shared stylesheet for index.html and collection.html
========================================================= */

/* =========================================================
   1. GLOBAL / BASE STYLES
========================================================= */

:root {
    --page-bg: #f2efe9;
    --text-main: #565454;
    --panel-bg: #fffdf9;
    --soft-border: #cfc7bc;
    --binder-bg: #111111;
    --accent-highlight: #f5f1ad;
    --shadow-soft: 0 6px 12px rgba(0,0,0,0.18);
    --shadow-panel: 0 10px 25px rgba(0,0,0,0.20);
}

* {
    box-sizing: border-box;
}

/* FOR TEST ONLY */

/* * {
    outline: 1px solid red;
}  */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
}



h1 {
    margin: 0;
    text-align: center;
}

h3 {
    margin: 0;
    text-align: center;
}

input,
select,
button {
    border: 1px solid var(--soft-border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--panel-bg);
}

input,
select {
    box-shadow: var(--shadow-soft);
}

button {
    border-color: var(--accent);
    cursor: pointer;
}

button:hover {
    box-shadow: var(--shadow-soft);
}

.disabledBtn {
    opacity: 0.6;
    cursor: not-allowed;
}

.disabledBtn:hover {
    opacity: 0.7;
}

/* =========================================================
   FUTURE THEME WORK
========================================================= */

.theme-classic {
    --bg-main: #f4f7fc;
    --card-bg: white;
    --accent: #5d7ea6;
    --border: #d8e1ee;
}

.theme-metallic {
    --bg-main: linear-gradient(
        135deg,
        #d9d9d9,
        #b9bcc3,
        #e4e4e4
    );
    --card-bg: rgba(255,255,255,.92);
    --accent: #66707d;
}

.theme-leather {
    --bg-main: linear-gradient(
        135deg,
        #4d2e1f,
        #5f3a28,
        #3f2418
    );
    --card-bg: rgba(255,255,255,.95);
    --accent: #8b5a3c;
}

.theme-carbon {
    --bg-main:
        repeating-linear-gradient(
            45deg,
            #202020,
            #202020 10px,
            #262626 10px,
            #262626 20px
        );

    --card-bg: rgba(255,255,255,.94);
    --accent: #3d4d66;
}

/*
FUTURE PREMIUM THEMES BELOW \/ \/
*/


/* =========================================================
   2. SHARED NAVIGATION
========================================================= */

.siteLogo {
    display: flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: inherit;

    font-size: 1.8rem;
    font-weight: bold;
}

.siteLogo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.siteLogo:hover {
    opacity: 0.85;
}

.navBar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    position: sticky;
    top: 0;
    z-index: 1000;

    background-color: rgba(155, 181, 220, 0.7);
    font-size: 18px;
    color: #000;

    padding: 15px 30px;
}

.navLinks {
    display: flex;
    gap: 30px;
}

.navBar a {
    color: black;
    text-decoration: none;
}

.navBar a:hover {
    opacity: 0.7;
}

/* =========================================================
   3. INDEX PAGE / EXPLORE PAGE
   Temporary API/search area. Later this can become Explore.
========================================================= */

.landingPage {
    margin: 48px 0;
}

.statsGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.statCard {
    aspect-ratio: 2.5 / 3.5;
    border: 6px solid #2f5f8f;
    border-radius: 18px;
    padding: 18px;

    background: rgba(255,255,255,0.72);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;

    text-align: center;
    box-shadow: 0 16px 24px -18px rgba(0,0,0,0.45);
}

.statCard label {
    font-size: 1rem;
    font-weight: 700;
}

.statCard p {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}




.sectionDivider {
    width: 100%;
    height: 2px;
    background-color: #000000;
    margin: 40px 0;
}

.cardLearnSection {
    display: grid;
    grid-template-columns: 0.6fr 0.8fr;
    gap: 15px;
    align-items: stretch;
}

#apiCardDisplay {
    margin-left: -400px;
}

#tooltipsSection {
    text-align: left;
    margin-left: -400px;
}

#apiCardDisplay h2,
#tooltipsSection h2 {
    margin-top: 0;
}

#apiCardDisplay h2 {
    margin: 0 0 12px 0;
}

.apiCardResult {
    text-align: center;
    margin: 0;
}

.apiCardResult img {
    width: min(100%, 200px);
    height: auto;
}

.infoLabel {
    font-weight: bold;
    font-size: 16px;
}

.infoText {
    font-size: 13px;
    opacity: 0.8;
}

.bottomNav {
    width: 100%;
    min-height: 200px;

    background-color: #28272e;
    color: #ddd;

    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;

    padding: 30px;
}

.bottomNav a {
    display: block;
    color: #ddd;
    text-decoration: none;
    margin: 6px 0;
}

.bottomNav a:hover {
    color: white;
}

@media (max-width: 768px) {
    .cardLearnSection {
        grid-template-columns: 1fr;
        align-items: center;
        margin-left: 0;
        width: 100%;
    }

    #apiCardDisplay,
    #tooltipsSection {
        margin-left: 0;
    }

    .bottomNav {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   4. COLLECTION EDITOR
   Add Card section and image preview area.
========================================================= */



.input {
    width: 320px;
    max-width: 100%;
}

#imagePreviewBox {
    width: 280px;
    aspect-ratio: 63 / 88;
    min-height: auto;

    border-radius: 16px;
    padding: 10px;
    border: 3px solid rgba(28, 26, 26, 0.80);
    background-color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

#imagePreviewBox img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
}


/* =========================================================
   5. LANDING PAGE STRUCTURE
========================================================= */

.landingPage {
    min-height: 100vh;
    padding: 48px 0;
}

.landingContent {
    width: min(88vw, 1200px);
    margin: 0 auto;
}

.landingHero,
.landingStats,
.setProgressSection,
.featuresSection,
.feedbackSection {
    margin-bottom: 48px;
}

.setProgressSection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setCard {
    border-radius: 18px;
    padding: 20px;

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

    box-shadow: 0 12px 20px -14px rgba(0,0,0,0.4);
}

.setHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 1.1rem;
    font-weight: bold;

    cursor: pointer;
}

.setDetails {
    display: none;
    margin-top: 12px;
}

.setCard.open .setDetails {
    display: block;
}

.setCard.open .setArrow {
    transform: rotate(180deg);
}

.setArrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

/*  SUGGESTIONS LINK  */

.quietFeedback, .quietFeedback a, .sidebarSection small a {
    font-size: 12px;
    opacity: 0.65;
}

.quietFeedback a:hover, .sidebarSection small a:hover {
    opacity: 1;
}


/*  Progress Bar CSS  */

.progressBar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(0,0,0,0.12);

    overflow: hidden;
    margin: 10px 0;
}

.progressFill {
    height: 100%;
    border-radius: 999px;
    background: rgba(120, 190, 255, 0.75);
}

.landingHero {
    min-height: 360px;
    border-radius: 32px;
    padding: 48px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;

    text-align: center;
    
}

.statsGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.statCard,
.setProgressCard,
.featureCard {
    border-radius: 22px;
    padding: 22px;
    background: rgba(255,255,255,0.55);
    box-shadow: 0 14px 22px -16px rgba(0,0,0,0.35);
}



.setProgressList {
    display: grid;
    gap: 14px;
}

.featuresGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}


/* =========================================================
   5. BINDER WORKSPACE
   Main app shell, binder page, card grid, sidebar, navigation.
========================================================= */

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

#vaultDataBox {
    width: 100%;
    min-height: 180px;
    margin-top: 10px;
    resize: vertical;
    font-size: 11px;
}


.pageSection {
    width: min(88vw, 1200px);
    margin: 32px auto;
    box-shadow: 0 18px 30px -18px rgba(0,0,0,0.35);
}

#vaultBinderApp {
    min-height: 100vh;
    background: var(--bg-main);
    position: relative;
}

#binderViewport {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#binderHeader {
    text-align: center;
}

#binderTabs {
    max-width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: hidden;
}

.binderTab {
    flex: 1 1 140px;
    max-width: 220px;
    min-width: 0;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    padding: 10px 18px;
    border-radius: 14px 14px 0 0;
    font-weight: 700;
}

.binderTab.active {
    background: var(--active-tab-color);
    color: white;
}

.binderTab.addTab {
    flex: 0 0 44px;
    max-width: 44px;
    min-width: 44px;
}

#binderBook {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

#binderPage {
    --columns: 4;
    --rows: 4;

    width: 100%;
    min-height: 190vh;
    padding: 28px;

    display: grid;
    grid-template-columns: repeat(var(--columns), 240px);
    grid-template-rows: repeat(var(--rows), 336px);
    justify-content: center;
    align-content: start;
    gap: 28px;

    border-radius: 36px;
    background: var(--active-tab-color);
    overflow: hidden;
}

.binderCard {
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding: 10px;
    border-radius: 16px;
    overflow: hidden;

    color: white;
    text-align: center;
    opacity: 0.9;

    background:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.08),
            rgba(255,255,255,0.08) 8px,
            rgba(255,255,255,0.03) 8px,
            rgba(255,255,255,0.03) 16px
        ),
        rgba(255,255,255,0.18);

    border: 1px solid rgba(255,255,255,0.25);

    box-shadow:
        0 4px 10px rgba(0,0,0,0.10),
        inset 0 1px 0 rgba(255,255,255,0.20),
        inset 0 0 18px rgba(255,255,255,0.03);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition: transform 0.2s ease, opacity 0.2s ease;
}

.binderCard:hover {
    transform: translateY(-2px);
    opacity: 1;
}

/* NEW Selected Card Underline :D*/
.selectedCard::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 8px;
    height: 4px;

    border-radius: 999px;
    background: var(--accent-highlight);
    box-shadow: 0 0 10px rgba(245, 241, 173,0.8);
}

.cardTopTabs,
.cardBottomActions {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.cardTopTabs button,
.cardBottomActions button {
    padding: 5px 8px;
    font-size: 12px;
}

.cardBottomActions {
    margin-top: auto;
}

.mainCardArea {
    flex: 1;
    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.emptySlot {
    opacity: 0.65;
}

.emptySlotContent {
    text-align: center;
}

.emptySlotContent h3 {
    margin: 0;
}

.emptySlotContent p {
    opacity: 0.7;
}

.testSlot {
    width: 240px;
    aspect-ratio: 63 / 88;
    color: black;
}

#imageView,
#infoView,
#optionsView,
.compactInfoView,
.optionsView,
.emptyCardSlot {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.emptyCardSlot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: none;
    background: transparent;
    text-align: center;
}

.emptyCardIcon {
    font-size: 48px;
    opacity: 0.35;
    margin-bottom: 12px;
}

.emptyCardSlot h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
}

.emptyCardSlot p {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

.compactInfoView {
    padding: 8px;
    overflow: auto;
}

.infoMiniRow {
    display: flex;
    justify-content: space-between;
    gap: 8px;

    font-size: 0.72rem;
    padding: 4px 0;
}

.miniLabel {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f2f2f2;
}

.miniValue {
    font-size: 0.7rem;
    color: #ffffff;
    text-align: right;
}

#editDrawer {
    position: fixed;
    top: 0;
    right: -350px;

    width: 350px;
    height: 100vh;

    background: white;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);

    transition: right 0.3s ease;

    overflow-y: auto;
    z-index: 1000;
}

#editDrawer.open {
    right: 0;
}

.glassPanel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    border: 1px solid rgba(255,255,255,0.45);

    box-shadow: 0 18px 40px rgba(0,0,0,0.18);

    border-radius: 18px;
}

.optionsView {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.binderCardImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

#binderSidebar {
    position: fixed;
    top: 90px;
    left: -300px;

    width: 280px;
    height: 100vh;
    padding: 20px;

    background: rgba(255, 255, 255, 0.08);
    z-index: 1000;

    transition: left 0.25s ease;    
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#binderSidebar.open {
    left: 0;
}

.sidebarSection {
    margin-top: 18px;
}

.sidebarSection button {
    width: 100%;
    margin: 5px 0;
}

#binderSidebar {
    background: var(--card-bg);
}

#openSidebarBtn {
    position: fixed;
    left: 12px;
    top: 120px;
    z-index: 1001;
}

#closeSidebarBtn {
    float: right;
}

#binderNavigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 32px;
}

#pageSlider {
    min-width: 180px;
}

/* =========================================================
   6. LEGACY CARD COMPONENTS
   Keep only while old selected-card/editor code still exists.
   Remove after binderCard fully replaces these.
========================================================= */

.cardContainer {
    display: grid;
    grid-template-columns: 60px 1fr;

    width: 440px;
    padding: 12px;
    gap: 12px;

    border-radius: 12px;
    background-color: #8e8b86;
}

.cardActionRow {
    grid-column: span 2;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#buttonSideBar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    height: 100%;
}

.funcButton {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    border: none;
}

.cardContent {
    position: relative;
}

#imageView img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

#infoView {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.inputBox {
    height: 36px;
    padding: 0 10px;

    border-radius: 10px;
    border: none;

    width: 100%;
}

.inputBox::placeholder {
    color: #888;
    font-style: italic;
}

.fullWidth {
    grid-column: span 2;
}

/* NEW SETUP */

#quikAddBar {
    width: min(90vw, 900px);
    margin: 24px auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

#quikAddBar h1 {
    margin-right: auto;
}

#addCardPanel {
    width: min(82vw, 1050px);
    margin: 24px auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}

.addCardFields {
    display: grid;
    gap: 14px;
}

.addCardFields label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.addCardFields input, .addCardFields select {

    width: 70%;
}

.addCardPreview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* =========================================================
   7. LEGACY SELECTED CARD EDIT ROWS
   Keep while still used; remove when selected section retires.
========================================================= */

.editRow {
    padding: 12px;
    display: grid;
    gap: 25px;
    grid-template-columns: 100px 8% 150px;
}

#selectedName {
    min-width: 0;
    word-break: break-word;
}

#ExampleText {
    color: var(--text-main);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    text-align: center;
}

/* =========================================================
   8. POPUPS
========================================================= */

#settingsPopup,
#notesPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #f2efe9;
    color: #444;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-panel);

    z-index: 1000;
}

#settingsPopup {
    width: 400px;
    height: 500px;
}

#notesPopup {
    width: 400px;
    height: 300px;
}

#notesInput {
    width: 100%;
    min-height: 120px;
    padding: 10px;

    border-radius: 10px;
    border: none;

    resize: none;
    font-family: inherit;
}

#settingsBtn.active {
    background-color: var(--accent-soft);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2);
}

/* =========================================================
   10. UTILITIES / ANIMATIONS
========================================================= */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;

    background: #2e7d32;
    color: white;

    padding: 12px 20px;
    border-radius: 10px;

    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);

    opacity: 0;
    pointer-events: none;

    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.loadingSpinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #2f5f9f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 30px auto;
}

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



/*

MEDIA CSS

*/

@media (max-width: 800px) {
    .statsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .statsGrid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 768px) {

    #quikAddBar {
        flex-direction: column;
        align-items: stretch;
        width: 92vw;
    }

    #addCardPanel {
        width: 92vw;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .addCardPreview {
        order: -1;
    }

    #imagePreviewBox {
        width: 220px;
        aspect-ratio: 63 / 88;
    }

    #binderTabs {
        width: 92vw;
        overflow-x: auto;
    }

    #binderPage {
        width: 92vw;
        padding: 18px;
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        grid-template-rows: auto;
        gap: 16px;
        min-height: auto;
        overflow: visible;
    }

    .binderCard {
        aspect-ratio: 63 / 88;
        height: auto;
    }
}