/* --- Variables & Global --- */
:root {
    --cwp-red: #d42426;
    --cwp-green: #165b33;
    --cwp-gold: #f8b229;
    --cwp-dark: #0a0a0a;
    --cwp-light: #ffffff;
    --font-festive: 'Mountains of Christmas', cursive;
    --font-body: 'Roboto', sans-serif;
}

#cwp-app-wrapper {
    position: relative;
    /* Replace with your actual background image path */
    background: url('images/bg-main.jpg') no-repeat center center / cover;
    background-color: var(--cwp-dark); /* Fallback */
    min-height: 600px;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--cwp-light);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- Animations & Overlays --- */
/* Snow Animation */
.cwp-overlay-snow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve"><circle fill="%23FFFFFF" cx="512" cy="512" r="10"/></svg>'), url('data:image/svg+xml;utf8,<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve"><circle fill="%23FFFFFF" cx="512" cy="512" r="7"/></svg>');
    background-size: 300px 300px, 150px 150px;
    animation: cwpSnow 15s linear infinite;
    z-index: 2;
    opacity: 0.6;
}

@keyframes cwpSnow {
    0% { background-position: 0px 0px, 0px 0px; }
    100% { background-position: 200px 600px, 100px 300px; }
}

/* Lights Animation */
.cwp-overlay-lights {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 30px;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--cwp-red) 2px, transparent 5px), radial-gradient(circle, var(--cwp-gold) 2px, transparent 5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 0;
    animation: cwpBlink 2s ease-in-out infinite alternate;
    z-index: 3;
}
@keyframes cwpBlink { 
    0% { opacity: 0.4; } 100% { opacity: 1; } 
}

/* Flying Santa */
.cwp-flying-santa {
    position: absolute;
    top: 10%;
    left: -200px;
    width: 150px;
    animation: cwpFlySanta 25s linear infinite;
    z-index: 4;
    pointer-events: none;
}
.cwp-flying-santa img { width: 100%; height: auto; }

@keyframes cwpFlySanta {
    0% { left: -200px; transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(50px) rotate(5deg); }
    100% { left: 110%; transform: translateY(0) rotate(-5deg); }
}

/* --- App Container & UI --- */
.cwp-container {
    position: relative;
    z-index: 10;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(5px);
    max-width: 800px;
    margin: 20px auto;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid var(--cwp-gold);
}

.cwp-header h1 {
    font-family: var(--font-festive);
    color: var(--cwp-gold);
    text-align: center;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px var(--cwp-red);
}

/* Countdown */
#cwp-countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
#cwp-countdown div {
    background: var(--cwp-red);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.8em;
    border: 1px solid var(--cwp-gold);
    min-width: 55px;
}
#cwp-countdown span {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    font-family: var(--font-festive);
}

/* Tabs */
.cwp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--cwp-gold);
}
.cwp-tab-link {
    background: rgba(255,255,255,0.1);
    color: var(--cwp-light);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    flex-grow: 1;
    border-radius: 8px 8px 0 0;
    transition: 0.3s;
    font-weight: bold;
}
.cwp-tab-link.active, .cwp-tab-link:hover {
    background: var(--cwp-red);
    color: var(--cwp-gold);
}
.cwp-tab-content {
    display: none;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.cwp-tab-content h2 {
    font-family: var(--font-festive);
    color: var(--cwp-gold);
    margin-top: 0;
}

/* Buttons & Inputs */
.cwp-btn {
    background: linear-gradient(to bottom, var(--cwp-red), var(--cwp-green));
    border: 2px solid var(--cwp-gold);
    color: var(--cwp-light);
    padding: 12px 20px;
    font-size: 1.1em;
    font-family: var(--font-festive);
    cursor: pointer;
    border-radius: 30px;
    width: 100%;
    margin-top: 10px;
    transition: transform 0.2s;
}
.cwp-btn:hover { transform: scale(1.02); }
.cwp-btn-secondary { background: #444; }

input[type=text], select, textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid var(--cwp-gold);
    background: rgba(255,255,255,0.9);
    color: #333;
}

/* Feature Specific */
.cwp-wish-box {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2em;
    font-style: italic;
    border: 1px dashed var(--cwp-gold);
}

.canvas-container {
    width: 100%;
    overflow: hidden;
    margin: 15px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.canvas-container.icon-bg { background-color: var(--cwp-red); }
canvas { width: 100%; height: auto; display: block; background: #fff;}

.cwp-mic-container {
    text-align: center;
    margin: 20px 0;
}
.cwp-mic-btn {
    background: var(--cwp-red);
    width: 70px; height: 70px;
    border-radius: 50%;
    border: 3px solid var(--cwp-gold);
    color: white;
    font-size: 30px;
    cursor: pointer;
}
.cwp-mic-btn.listening { animation: pulse 1.5s infinite; background: var(--cwp-green); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(248, 178, 41, 0.7); } 70% { box-shadow: 0 0 0 20px rgba(248, 178, 41, 0); } 100% { box-shadow: 0 0 0 0 rgba(248, 178, 41, 0); } }

/* Responsive adjustments */
@media (max-width: 600px) {
    .cwp-header h1 { font-size: 2em; }
    #cwp-countdown span { font-size: 1.2em; }
    #cwp-countdown div { min-width: 45px; padding: 5px; }
    .cwp-tab-link { padding: 8px 10px; font-size: 0.9em; }
}