/* style.css - Gift Box Universal Reward System */
/* Secure, Modular, and Demo-Ready */

/* ====== ROOT VARIABLES & RESET ====== */
:root {
    --primary: #6c63ff;
    --primary-dark: #554fd8;
    --secondary: #ff6584;
    --success: #36d1a3;
    --warning: #ffb347;
    --dark: #2a2d3e;
    --light: #f8f9fe;
    --gray: #a0a7c2;
    --border-radius: 16px;
    --box-shadow: 0 10px 30px rgba(108, 99, 255, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7ff 0%, #eef1ff 100%);
    color: var(--dark);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ====== HEADER ====== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--primary);
}

header h1 {
    color: var(--primary);
    font-size: 2.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.philosophy {
    background: var(--dark);
    color: white;
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 0.5px;
    margin-top: 15px;
    box-shadow: 0 5px 15px rgba(42, 45, 62, 0.2);
}

/* ====== MODULE SECTIONS ====== */
.module {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(108, 99, 255, 0.1);
    transition: var(--transition);
}

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(108, 99, 255, 0.2);
}

.module h2 {
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0ff;
}

/* ====== DESIRE BUTTONS ====== */
.desire-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
}

.desire-btn {
    flex: 1;
    min-width: 200px;
    padding: 22px 20px;
    border: 2px solid #e0e4ff;
    background: white;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.desire-btn i {
    font-size: 2.2rem;
    color: var(--primary);
}

.desire-btn[data-domain="kfc"]:hover {
    border-color: #ff6584;
    background: #fff5f7;
    color: #e04e6d;
}

.desire-btn[data-domain="telco"]:hover {
    border-color: #36d1a3;
    background: #f0fffa;
    color: #1daa80;
}

.desire-btn.active {
    border-width: 3px;
    transform: scale(1.03);
}

.desire-btn[data-domain="kfc"].active {
    border-color: #ff6584;
    background: linear-gradient(135deg, #fff5f7 0%, #ffeef1 100%);
    color: #d81a4e;
}

.desire-btn[data-domain="telco"].active {
    border-color: #36d1a3;
    background: linear-gradient(135deg, #f0fffa 0%, #e6fff5 100%);
    color: #0e8f68;
}

.desire-display {
    background: #f8f9ff;
    padding: 18px;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 5px solid var(--primary);
}

#chosen-desire {
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ====== FLOW DIAGRAM ====== */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 2px solid #e0e4ff;
}

.flow-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--primary);
    padding: 0 10px;
}

.flow-status {
    background: var(--dark);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-top: 25px;
}

#flow-status {
    color: var(--warning);
    font-weight: bold;
}

/* ====== DEBUG PANEL ====== */
.debug-panel {
    background: #1a1c2b;
    color: #e0e4ff;
    padding: 25px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    border: 1px solid #2a2d3e;
}

.debug-panel h3 {
    color: var(--success);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.debug-line {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #2a2d3e;
}

.debug-line span:first-child {
    color: #a0a7c2;
}

.debug-line span:last-child {
    color: var(--success);
    font-weight: bold;
}

/* ====== REWARD BOX ====== */
.reward-box {
    background: linear-gradient(135deg, #6c63ff 0%, #8a84ff 100%);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: 0 15px 40px rgba(108, 99, 255, 0.3);
}

.reward-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.box-lid {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.reward-message {
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: bold;
}

.reward-details {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.partner-note {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 20px;
}

.action-btn {
    width: 100%;
    padding: 22px;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(108, 99, 255, 0.4);
}

.action-btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ====== FOOTER ====== */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e4ff;
    color: var(--gray);
    font-size: 0.9rem;
}

footer strong {
    color: var(--primary);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .desire-buttons {
        flex-direction: column;
    }
    
    .flow-diagram {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
        padding: 5px 0;
    }
    
    .module {
        padding: 20px;
    }
}

/* ====== SECURITY NOTE ====== */
/* ENGIne core logic is secured in engine.js */
/* Domain parameters secured in config.js */
/* No sensitive data exposed in CSS */
