/* =========================================================
   PAPAN REFLEKSI SISWA (PADLET-STYLE) - DESKTOP THEME
   Gasik 7 KAIH - SMAN 2 Ngaglik
   ========================================================= */

:root {
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    
    /* Warna Pastel Kebiasaan */
    --bangun-bg: #fefce8;
    --bangun-border: #fef08a;
    --bangun-badge: #ca8a04;
    --bangun-tag-bg: #fef9c3;

    --ibadah-bg: #f0fdf4;
    --ibadah-border: #bbf7d0;
    --ibadah-badge: #16a34a;
    --ibadah-tag-bg: #dcfce7;

    --tidur-bg: #f5f3ff;
    --tidur-border: #ddd6fe;
    --tidur-badge: #7c3aed;
    --tidur-tag-bg: #ede9fe;

    --kegiatan-bg: #fff7ed;
    --kegiatan-border: #fed7aa;
    --kegiatan-badge: #ea580c;
    --kegiatan-tag-bg: #ffedd5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Dekorasi Latar Belakang Gelembung Halus */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.circle-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.blob-1 {
    width: 450px;
    height: 450px;
    background: #c7d2fe;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #fbcfe8;
    bottom: -150px;
    right: -100px;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #fef08a;
    top: 40%;
    left: 60%;
}

/* Container Utama */
.padlet-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px 60px;
}

/* HEADER */
.padlet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 20px 28px;
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.school-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4338ca;
    background: #e0e7ff;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 4px;
}

.header-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.highlight-class {
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-greeting-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.user-avatar-mini {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-greeting-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
}

.user-name-text {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: #334155;
    background: white;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.btn-back-home:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

/* TOOLBAR & FILTER */
.padlet-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 14px 20px;
    margin-bottom: 28px;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.03);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-btn {
    border: none;
    outline: none;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.pill-btn.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    box-shadow: 0 4px 10px rgba(30, 41, 59, 0.2);
}

.pill-btn.pill-bangun.active {
    background: #ca8a04;
    border-color: #ca8a04;
    box-shadow: 0 4px 10px rgba(202, 138, 4, 0.25);
}

.pill-btn.pill-ibadah.active {
    background: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
}

.pill-btn.pill-tidur.active {
    background: #7c3aed;
    border-color: #7c3aed;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

.pill-btn.pill-kegiatan.active {
    background: #ea580c;
    border-color: #ea580c;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-periode {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    background: white;
    color: #334155;
    outline: none;
    cursor: pointer;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-tulis {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-tulis:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-pdf {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-pdf:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* STATES (LOADING & EMPTY) */
.state-container {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    border: 2px dashed #cbd5e1;
    margin-top: 20px;
}

.bouncy-spinner {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 16px;
}

.empty-sticker {
    font-size: 56px;
    margin-bottom: 12px;
    animation: floatSticker 3s ease-in-out infinite;
}

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

.state-container h3 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 8px;
}

.state-container p {
    font-size: 13px;
    color: #64748b;
    max-width: 420px;
    margin: 0 auto;
}

/* CARDS GRID (PADLET MASONRY STYLE) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 10px;
}

/* CARD STYLES */
.refleksi-card {
    background: white;
    border-radius: 22px;
    padding: 20px;
    border: 2px solid transparent;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardPop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.refleksi-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.08);
}

/* VARIAN WARNA CARD SESUAI KEBIASAAN */
.refleksi-card.card-bangun {
    background: var(--bangun-bg);
    border-color: var(--bangun-border);
}

.refleksi-card.card-ibadah {
    background: var(--ibadah-bg);
    border-color: var(--ibadah-border);
}

.refleksi-card.card-tidur {
    background: var(--tidur-bg);
    border-color: var(--tidur-border);
}

.refleksi-card.card-kegiatan {
    background: var(--kegiatan-bg);
    border-color: var(--kegiatan-border);
}

/* PIN STICKER (Ala Padlet) */
.card-pin {
    position: absolute;
    top: -10px;
    right: 24px;
    font-size: 20px;
    transform: rotate(15deg);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* HEADER CARD */
.card-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.student-photo-frame {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.student-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.card-user-meta {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-habit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.card-bangun .card-habit-badge {
    background: var(--bangun-tag-bg);
    color: var(--bangun-badge);
}

.card-ibadah .card-habit-badge {
    background: var(--ibadah-tag-bg);
    color: var(--ibadah-badge);
}

.card-tidur .card-habit-badge {
    background: var(--tidur-tag-bg);
    color: var(--tidur-badge);
}

.card-kegiatan .card-habit-badge {
    background: var(--kegiatan-tag-bg);
    color: var(--kegiatan-badge);
}

/* BODY CARD */
.card-content-body {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.quote-icon {
    font-size: 14px;
    color: #94a3b8;
    margin-right: 4px;
}

.reflection-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #334155;
    word-break: break-word;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* FOOTER CARD */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.badge-owner {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 10px;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeInOverlay 0.25s ease;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 24px 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.modal-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #ec4899;
    background: #fce7f3;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.btn-close-modal {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-close-modal:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-body .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.modal-body label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.modal-select,
.modal-textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.modal-select:focus,
.modal-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.photo-picker-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tab-photo {
    flex: 1;
    padding: 7px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
}

.tab-photo.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.file-input-custom {
    width: 100%;
    font-size: 12px;
}

.camera-preview-box {
    width: 100%;
    height: 180px;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.camera-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-snap-photo {
    width: 100%;
    padding: 9px;
    border-radius: 10px;
    background: #10b981;
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 12px;
}

.preview-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #6366f1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 6px;
}

.btn-hapus-foto {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-modal-cancel {
    flex: 1;
    padding: 11px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-modal-submit {
    flex: 2;
    padding: 11px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-modal-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* PRINT & PDF EXPORT STYLING */
@media print {
    body {
        background: white !important;
    }
    .bg-decoration,
    .padlet-toolbar,
    .btn-back-home,
    .modal-overlay {
        display: none !important;
    }
    .padlet-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
    }
    .cards-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    .refleksi-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        page-break-inside: avoid;
    }
}
