
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #005a9e;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 1em; 
    color: var(--text-color);
    background-image: url('https://informatika.usk.ac.id/webinf/wp-content/uploads/2019/11/3.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center; 
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    background-color: var(--card-bg);
    padding: 1.5em; 
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 2em;
}

header .logo {
    max-width: 150px;
    margin-bottom: 1em;
}

header h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5em; 
}

header p {
    color: #666;
    margin-top: 0.5em;
    font-size: 0.9em;
}

.survey-card {
    background-color: #ffffff;
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2em;
}

.survey-card h2 {
    margin-top: 0;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.2em; 
}
.emoji-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Ganti agar label tidak mendorong emoji lain */
    gap: 16px;
    margin: 2em 0;
    flex-wrap: wrap; 
}

.emoji-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}


.emoji-radio {
    display: none;
}

.emoji-label {
    width: 60px; 
    height: 60px;
    cursor: pointer;
    filter: grayscale(80%);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.5), filter 0.4s ease;
    background-size: cover;
    background-position: center;
}

.emoji-text-label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-align: center;
    transition: all 0.3s ease;
}
.emoji-label:hover {
    filter: grayscale(0%);
    transform: scale(1.15) translateY(-5px);
}
.emoji-radio:checked + .emoji-label {
    filter: grayscale(0%);
    transform: scale(1.2);
    animation: bounce 0.4s;
}

@keyframes sad-slump {
    0%   { transform: scale(1.15) rotate(0deg); }
    50%  { transform: scale(1.1) translateY(5px) rotate(-8deg); }
    100% { transform: scale(1.15) rotate(0deg); }
}

/* Animasi untuk emoji Bingung (gemetar) */
@keyframes confused-jitter {
    0%   { transform: scale(1.15) rotate(0deg); }
    25%  { transform: scale(1.2) rotate(-4deg); }
    50%  { transform: scale(1.15) rotate(4deg); }
    75%  { transform: scale(1.2) rotate(-4deg); }
    100% { transform: scale(1.15) rotate(0deg); }
}

/* Animasi untuk emoji Netral (berdenyut tenang) */
@keyframes neutral-pulse {
    0%   { transform: scale(1.15); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1.15); }
}

/* Animasi untuk emoji Senang (bergoyang gembira) */
@keyframes joyful-wobble {
    0% { transform: scale(1.15) rotate(0deg); }
    25% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1.15) rotate(0deg); }
}

/* Animasi untuk emoji Cinta (detak jantung) */
@keyframes love-beat {
    0%   { transform: scale(1.15); }
    30%  { transform: scale(1.3); }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1.15); }
}

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

.happy + .emoji-label:hover { filter: grayscale(0%) drop-shadow(0 6px 12px rgba(244, 211, 72, 0.7)); animation: joyful-wobble 0.5s ease-in-out; }
.sad + .emoji-label:hover { filter: grayscale(0%) drop-shadow(0 6px 10px rgba(100, 149, 237, 0.6)); animation: sad-slump 0.7s ease-in-out; }
.confused + .emoji-label:hover { filter: grayscale(0%) drop-shadow(0 6px 12px rgba(186, 85, 211, 0.6)); animation: confused-jitter 0.4s ease-in-out; }
.neutral + .emoji-label:hover { filter: grayscale(0%) drop-shadow(0 6px 12px rgba(128, 128, 128, 0.5)); animation: neutral-pulse 1s infinite ease-in-out; }
.love + .emoji-label:hover { filter: grayscale(0%) drop-shadow(0 6px 12px rgba(255, 20, 20, 0.6)); animation: love-beat 0.8s infinite ease-in-out; }


.sad + .emoji-label { background-image: url('images/sad.png'); }
.confused + .emoji-label { background-image: url('images/confused.png'); }
.neutral + .emoji-label { background-image: url('images/neutral.png'); }
.happy + .emoji-label { background-image: url('images/happy.png'); }
.love + .emoji-label { background-image: url('images/love.png'); }

.emoji-result-text {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    transition: all 0.3s ease;
}
.emoji-result-text span {
    font-weight: 700;
}

p.rating-info {
    text-align: center;
    font-size: 0.9em;
    color: #777;
    margin-bottom: 1.5em;
}

.rating-desc {
    display: flex;
    justify-content: center;
    flex-direction: row-reverse;
}

.rating-desc input[type="radio"] {
    display: none;
}

.rating-desc label {
    font-size: 1.8em;
    padding: 0.3em 0.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ccc;
}

.rating-desc label:hover,
.rating-desc label:hover ~ label,
.rating-desc input[type="radio"]:checked ~ label {
    color: var(--secondary-color);
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
}

.submit-btn:hover {
    background-color: #004a88;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    margin-top: 2em;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

@media (min-width: 768px) {
    body {
        padding: 2em;
    }

    .container {
        padding: 2.5em;
    }

    header h1 {
        font-size: 2.2em;
    }

    header p {
        font-size: 1.1em;
    }

    .survey-card h2 {
        font-size: 1.5em;
    }

    .emoji-label {
        width: 100px; 
        height: 100px;
    }

    .emoji-text-label {
        font-size: 16px; 
    }

    .emoji-container {
        gap: 25px; 
    }
}

@media (max-width: 600px) {
    body {
        padding: 1em; 
    }

    .container {
        padding: 1em; 
    }
    
    .survey-card {
        padding: 1.5em;
    }

    .emoji-label {
        width: 50px; 
        height: 50px;
    }
    
    .emoji-container {
        gap: 10px; 
    }

    h1 {
        font-size: 1.8em;
    }

    .rating-desc label {
        font-size: 1.5em; 
        padding: 0.2em 0.4em;
    }
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2em;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    border: 1px solid #a5d6a7;
}


/* Rekap Page Styling */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5em;
    margin-bottom: 2em;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 0.5em 0;
    color: var(--primary-color);
    font-size: 1.1em;
}

.stat-card p {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-color);
}

.chart-container {
    background-color: var(--card-bg);
    padding: 2em;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2em;
}
.chart-container h2{
    text-align: center;
    color: var(--primary-color);
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-top: 2em;
}

.action-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
}
.action-btn.danger {
    background-color: #d32f2f;
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-bottom: 2em;
}

.filter-btn {
    padding: 10px 20px;
    font-size: 0.9em;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

header .logo {
    max-width: 150px; 
    margin-bottom: 1em;
}

.stat-card h3 {
    font-size: 1em;
}

.stat-card p {
    font-size: 2.2em;
}


/* --- SKELETON LOADER STYLES --- */
.skeleton-loader {
    width: 100%;
}
.skeleton {
    opacity: 0.7;
    animation: skeleton-loading 1.5s infinite linear;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}
.skeleton-box {
    background-color: #e0e0e0;
    border-radius: 8px;
}
.skeleton .stat-card {
    background: none;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}
.skeleton .title {
    height: 20px;
    width: 60%;
    margin-bottom: 10px;
}
.skeleton .text {
    height: 40px;
    width: 40%;
}
.skeleton .chart {
    width: 100%;
    height: 300px; 
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
}

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

.feedback-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    animation: scale-up 0.4s forwards cubic-bezier(0.5, 0, 0.5, 1.5);
}

.feedback-circle.success { background-color: #28a745; }
.feedback-circle.error { background-color: #dc3545; }


@keyframes scale-up {
    from { transform: scale(0); }
    to { transform: scale(1); }
}


.checkmark {
    display: inline-block;
    width: 14px;
    height: 25px;
    border: solid white;
    border-width: 0 5px 5px 0; /* Membuat bentuk L */
    opacity: 0;
    transform: rotate(45deg);
    animation: draw-checkmark 0.3s 0.4s forwards;
}

@keyframes draw-checkmark {
    0% { width: 0; height: 0; opacity: 0; }
    40% { width: 14px; height: 0; opacity: 1; }
    100% { width: 14px; height: 25px; opacity: 1; }
}
.cross {
    width: 25px;
    height: 25px;
    position: relative;
    transform: scale(0);
    animation: scale-up 0.3s 0.2s forwards;
}
.cross::before, .cross::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 5px;
    top: 10px;
    left: 0;
    background-color: white;
    border-radius: 3px;
}
.cross::before { transform: rotate(45deg); }
.cross::after { transform: rotate(-45deg); }

@keyframes draw-cross {
    to { transform: rotate(45deg) scaleX(1); }
}
.cross::after { animation-name: draw-cross-2; }
@keyframes draw-cross-2 {
    to { transform: rotate(-45deg) scaleX(1); }
}

/* Ikon Silang (dibuat dari 2 div) */
.cross-line {
    position: absolute;
    background-color: white;
    width: 4px;
    height: 25px;
    border-radius: 2px;
    opacity: 0;
    animation: draw-cross 0.3s 0.2s forwards ease-out;
}
.cross-line.one {
    transform: rotate(45deg);
}
.cross-line.two {
    transform: rotate(-45deg);
}

@keyframes draw-cross {
    from { transform: scaleY(0) rotate(45deg); opacity: 0; }
    to { transform: scaleY(1) rotate(45deg); opacity: 1; }
}
.cross-line.two {
    animation-name: draw-cross-2;
}
@keyframes draw-cross-2 {
    from { transform: scaleY(0) rotate(-45deg); opacity: 0; }
    to { transform: scaleY(1) rotate(-45deg); opacity: 1; }
}

.emoji-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.emoji-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.emoji-text-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-align: center;
    transition: all 0.3s ease;
}

.emoji-radio:checked + .emoji-label + .emoji-text-label {
    font-weight: 700;
    color: var(--primary-color);
}
