/* =========================================
   1. GLOBAL RESET & BASE STYLES
   ========================================= */
:root {
    --bg-gradient: #333;
    --card-bg: #fff;
    --text-color: #333;
}

body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #222; height: 100vh; overflow: hidden; }

/* LAYOUT */
.app-container { display: flex; height: 100%; }
.controls { width: 320px; background: #fff; padding: 20px; overflow-y: auto; z-index: 10; flex-shrink: 0; border-right: 1px solid #444; }
.preview-area { flex: 1; background: #2d2d2d; display: flex; flex-direction: column; align-items: center; padding: 20px; overflow: hidden; }

/* UI ELEMENTS */
.toolbar { background: #444; padding: 10px 20px; border-radius: 8px; display: flex; gap: 15px; margin-bottom: 15px; color: white; align-items: center; }
.btn-download { background: #27ae60; color: white; border: none; padding: 8px 16px; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 1rem; }
.zoom-slider { display: flex; align-items: center; gap: 10px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.85rem; }
.form-group input, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-row { display: flex; gap: 10px; }
.form-group.half { width: 50%; }

/* SCROLL WRAPPER */
.graphic-wrapper { width: 100%; height: 100%; overflow: auto; display: flex; justify-content: center; background: #1a1a1a; padding: 20px; }

/* =========================================
   2. THE CALENDAR GRAPHIC (Base)
   ========================================= */
.calendar-graphic {
    width: 1080px;
    min-height: 1350px;
    height: auto; 
    padding: 50px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transform-origin: top center;
    transform: scale(0.6); 
    position: relative;
    
    /* FIX FOR BROKEN BACKGROUND */
    background-size: 100% 100% !important; /* Force stretch */
    background-repeat: no-repeat !important;
}

.header-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 15px; }
.header-text { text-align: center; flex: 1; }
.header-text h1 { margin: 0; font-size: 3.5rem; text-transform: uppercase; font-weight: 900; line-height: 1.1; }
.header-text h2 { margin: 0; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 3px; font-weight: 400; }
.logo { width: 110px; height: 110px; object-fit: contain; border-radius: 50%; }
.logo.hidden { opacity: 0; }

.grid-container { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 12px; 
    flex: 1; 
    align-content: start; 
    margin-bottom: 20px;
}

/* FIX FOR SQUEEZED TEXT */
.card { 
    position: relative; 
    height: 135px; 
    display: flex; 
    flex-direction: column; /* Stack items vertically */
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 10px; /* Reduced padding to give text more space */
    overflow: hidden; 
}

.prompt-text { 
    font-size: 0.9rem; 
    font-weight: 700; 
    line-height: 1.3; 
    margin: 0; 
    width: 100%; /* Force full width */
    word-wrap: break-word; /* Break long words */
    z-index: 2; 
}

/* Center the 31st Day */
.card:nth-child(31) { grid-column: 1 / -1; width: 155px; margin: 0 auto; }


/* =========================================
   3. THEME: "THE ELITES" (Purple)
   ========================================= */
#captureArea.theme-elites {
    background: radial-gradient(circle at center, #5e0a85, #2a0042);
    color: white;
}
#captureArea.theme-elites .header-section { border-bottom: 4px solid #d400ff; }
#captureArea.theme-elites h1 { color: #fff; text-shadow: 3px 3px 0 #d400ff; }
#captureArea.theme-elites h2 { color: #ffdbe6; }
#captureArea.theme-elites .card {
    background: #fff;
    color: #2a0042;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
#captureArea.theme-elites .day-badge {
    position: absolute;
    top: 8px; left: 8px;
    width: 35px; height: 35px;
    background: #2a0042;
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; border: 2px solid #d400ff;
}
#captureArea.theme-elites .footer-section { color: #d400ff; text-transform: uppercase; }


/* =========================================
   4. THEME: "FYB GOLD" (Blue Cards / Orange BG)
   ========================================= */
#captureArea.theme-fyb {
    /* Use fixed linear gradient to prevent split */
    background: linear-gradient(180deg, #ffb347 0%, #ffcc33 100%);
}
#captureArea.theme-fyb .header-section { border-bottom: none; }
#captureArea.theme-fyb .logo { border: 4px solid white; background: white; }
#captureArea.theme-fyb h1 { 
    color: #0056b3; 
    text-shadow: 2px 2px 0px white;
    background: rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
}
#captureArea.theme-fyb h2 { color: #333; font-weight: 800; }

/* FIX FOR WHITE CARDS -> FORCE BLUE */
#captureArea.theme-fyb .card {
    background-color: #007bff !important; /* Force Blue */
    color: white !important;
    border-radius: 12px;
    box-shadow: 0 4px 0 #fff, 0 8px 0 #cc0000;   
    border: 2px solid #0056b3;
    margin-bottom: 10px;
}
#captureArea.theme-fyb .day-badge {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #cc0000;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 900;
    border: 2px solid #cc0000;
}
#captureArea.theme-fyb .day-badge::before { content: "DAY "; }
#captureArea.theme-fyb .footer-section { color: #333; text-shadow: 1px 1px 0 white; }


/* =========================================
   5. THEME: "QUINTESSIA" (Modern Blue)
   ========================================= */
#captureArea.theme-quintessia {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
}
#captureArea.theme-quintessia .header-section { border-bottom: 2px solid rgba(255,255,255,0.5); }
#captureArea.theme-quintessia h1 { font-family: 'Brush Script MT', cursive; font-size: 5rem; color: #fff; }
#captureArea.theme-quintessia h2 { color: #e0f7fa; }

#captureArea.theme-quintessia .card {
    background: rgba(255,255,255,0.95);
    color: #004e92;
    border-radius: 15px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    border: none;
    padding-top: 35px; /* Space for the tab */
    align-items: center; /* Center text */
}

/* Fix text size for Quintessia */
#captureArea.theme-quintessia .prompt-text {
    width: 90%; /* Ensure text fits */
    color: #004e92;
}

#captureArea.theme-quintessia .day-badge {
    position: absolute;
    top: 0; left: 15px;
    background: #ff9900;
    color: white;
    width: 60px; height: 30px;
    border-radius: 0 0 10px 10px; 
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}
#captureArea.theme-quintessia .day-badge::before { content: "DAY "; margin-right: 3px; }
#captureArea.theme-quintessia .footer-section { color: white; opacity: 0.9; }