/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Rethink+Sans:wght@400;500;600;700;800&family=Gluten:wght@400;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Remove tap highlights on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for input elements and text content */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Rethink Sans', sans-serif;
    background: #ecdfff;
    min-height: 100vh;
    color: #612ab4;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    background: #ecdfff;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
}

/* Auth Section */
.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0px 10px 30px rgba(69, 0, 173, 0.2);
    margin-top: 50px;
}

.auth-content h2 {
    color: #612ab4;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 16px;
}

.auth-content p {
    color: #612ab4;
    opacity: 0.8;
    margin-bottom: 30px;
    font-size: 16px;
}

.connect-btn {
    background: linear-gradient(135deg, #741afa, #612ab4);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0px 8px 20px rgba(116, 26, 250, 0.3);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 12px 25px rgba(116, 26, 250, 0.4);
}

/* Date Navigation */
.date-navigation {
    margin: 0 0 30px 0;
    /* width: 100vw; */
    position: relative;
    /* left: 50%; */
    /* right: 50%; */
    /* margin-left: -50vw; */
    /* margin-right: -50vw; */
}

.date-picker {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding: 10px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* position: relative; */
}

/* Gradient fade effects */
.date-navigation::before,
.date-navigation::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25px;
    z-index: 2;
    pointer-events: none;
}

.date-navigation::before {
    left: 0;
    background: linear-gradient(to right, #ecdfff, transparent);
}

.date-navigation::after {
    right: 0;
    background: linear-gradient(to left, #ecdfff, transparent);
}

.date-navigation::-webkit-scrollbar {
    display: none;
}

.date-picker {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.date-picker::before,
.date-picker::after
{
    display: block;
    content: '';
    pointer-events: none;
    width: 108px;
    min-width: 108px;
    height: 64px;
}

.date-btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    min-width: 64px;
    max-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rethink Sans', sans-serif;
    flex-shrink: 0;
    aspect-ratio: 1;
    overflow: hidden;
}

.date-btn.active {
    background: white;
    border: 2px solid #741afa;
    box-shadow: 0px 3px 10px rgba(116, 26, 250, 0.15), 0px 1px 3px rgba(116, 26, 250, 0.15);
}

.date-btn.disabled {
    background: #dcc7fd;
    cursor: not-allowed;
    outline: none;
}
.date-btn.disabled:focus {
    outline: none;
}

.date-btn.disabled .date-number,
.date-btn.disabled .date-month {
    color: rgba(255, 255, 255, 0.4);
}

.date-number {
    font-size: 22px;
    font-weight: 800;
    color: #741afa;
    line-height: 1;
    font-family: 'Rethink Sans', sans-serif;
}

.date-month {
    font-size: 12px;
    font-weight: 600;
    color: rgba(116, 26, 250, 0.6);
    line-height: 1;
    font-family: 'Rethink Sans', sans-serif;
}

/* Questions Container */
.questions-container {
    max-width: 400px;
    margin: 0 auto;
}

.questions-title {
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #612ab4;
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.2;
}

/* Activities List */
.activities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Activity Cards - New Design */
.activity-card {
    background: white;
    border-radius: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.activity-card.collapsed {
    cursor: pointer;
}

.activity-card.expanded {
    cursor: default;
}

/* Past date activities - not interactive */
.activity-card.past-date {
    cursor: default;
    background: #e5d3ff;
}

.activity-card.past-date .collapsed-content {
    cursor: default;
}

.activity-card.expanded {
    box-shadow: 0px 10px 30px rgba(69, 0, 173, 0.2), 0px 1px 4px rgba(69, 0, 173, 0.15);
    margin: 8px 0 24px 0;
}

.activity-card.collapsed {
    box-shadow: none;
}
.activity-card.collapsed:hover {
    outline: 1px solid #7700ff;
    outline-offset: 1.5px;
}

/* Expanded Content */
.expanded-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Collapsed Content */
.collapsed-content {
    padding: 12px;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    cursor: pointer;
}


/* Activity Icons */
.activity-icon-expanded {
    width: 96px;
    height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.activity-icon-collapsed {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 72px;
    height: 72px;
}

.icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Activity Titles */
.activity-title-expanded {
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 500;
    font-size: 20px;
    color: #612ab4;
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

/* Score Options List (Expanded) */
.score-options-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.score-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    border: 1px solid #eadefd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rethink Sans', sans-serif;
}



.score-option:hover {
    background: #f8f6ff;
}

/* Score 1 - Belum mampu (Red) */
.score-option[data-score="1"].selected {
    background: #ffdada;
    border-color: #c40000;
}

.score-option[data-score="1"].selected .score-text {
    color: #c40000;
}

/* Score 2 - Perlu Banyak arahan (Orange/Brown) */
.score-option[data-score="2"].selected {
    background: #ffe4b1;
    border-color: #935f00;
}

.score-option[data-score="2"].selected .score-text {
    color: #935f00;
}

/* Score 3 - Perlu Sekali arahan (Green) */
.score-option[data-score="3"].selected {
    background: #b9ffb3;
    border-color: #0b8400;
}

.score-option[data-score="3"].selected .score-text {
    color: #0b8400;
}

/* Score 4 - Mandiri (Blue) */
.score-option[data-score="4"].selected {
    background: #c2f0ff;
    border-color: #0077bc;
}

.score-option[data-score="4"].selected .score-text {
    color: #0077bc;
}

/* Default unselected state */
.score-option .score-text {
    font-weight: 500;
    font-size: 16px;
    color: #612ab4;
}

.score-option .score-icon {
    font-size: 20px;
    color: #666;
}

/* Score option icons - selected state colors */
.score-option[data-score="1"].selected .score-icon {
    color: #c40000;
}

.score-option[data-score="2"].selected .score-icon {
    color: #935f00;
}

.score-option[data-score="3"].selected .score-icon {
    color: #0b8400;
}

.score-option[data-score="4"].selected .score-icon {
    color: #0077bc;
}

/* Score Indicators (Collapsed) */
.score-indicators {
    display: flex;
    gap: 6px;
    margin-left: 80px;
    flex: 1;
    align-items: center;
    pointer-events: none; /* Allow clicks to pass through to parent */
}

.score-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    pointer-events: none; /* Score indicators are read-only in collapsed state */
}

/* Score indicators - unselected state */
.score-indicator i {
    font-size: 20px;
    color: #cfbced;
}

/* Score 1 - Belum mampu (Red) */
.score-indicator[data-score="1"].selected {
    background: #ffdada;
    border: 1px solid #c40000;
}

.score-indicator[data-score="1"].selected i {
    font-size: 24px;
    color: #c40000;
}

/* Score 2 - Perlu Banyak arahan (Orange/Brown) */
.score-indicator[data-score="2"].selected {
    background: #ffe4b1;
    border: 1px solid #935f00;
}

.score-indicator[data-score="2"].selected i {
    font-size: 24px;
    color: #935f00;
}

/* Score 3 - Perlu Sekali arahan (Green) */
.score-indicator[data-score="3"].selected {
    background: #b9ffb3;
    border: 1px solid #0b8400;
}

.score-indicator[data-score="3"].selected i {
    font-size: 24px;
    color: #0b8400;
}

/* Score 4 - Mandiri (Blue) */
.score-indicator[data-score="4"].selected {
    background: #c2f0ff;
    border: 1px solid #0077bc;
}

.score-indicator[data-score="4"].selected i {
    font-size: 24px;
    color: #0077bc;
}

.collapsed-content .score-indicator{
    border-radius: 999px;
}
.collapsed-content .score-indicator.selected{
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.25), 0 4px 12px 0 rgba(0, 0, 0, 0.10);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-cancel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    background: #eadefd;
    color: #7700ff;
    border: none;
    border-radius: 20px;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    background: #7700ff;
    color: white;
    border: none;
    border-radius: 20px;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #d4c5f9;
}

.btn-save:hover {
    background: #6600cc;
}

/* Score Buttons */
.score-btn {
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Detailed Score Buttons (Expanded) */
.score-btn.detailed {
    background: #ffe8fc;
    color: #612ab4;
    padding: 14px 19px;
    width: 100%;
    justify-content: flex-start;
    font-size: 16px;
}

.score-btn.detailed.active {
    background: #ff00de;
    color: white;
}

.score-btn.detailed .score-number {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.score-btn.detailed .score-text {
    font-weight: 700;
    white-space: nowrap;
}

/* Compact Score Buttons (Collapsed) */
.score-btn.compact {
    background: #ffe8fc;
    color: #612ab4;
    width: 48px;
    height: 48px;
    font-size: 16px;
    font-weight: 800;
}

.score-btn.compact.active {
    background: #ff00de;
    color: white;
}

.score-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
}

.score-btn:active {
    transform: translateY(0);
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #612ab4;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f0f0f0;
}

.criteria-list {
    padding: 20px;
}

.criteria-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
}

.criteria-score {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-right: 15px;
    color: white;
    font-size: 18px;
}

.criteria-score.score-1 { background: #f44336; }
.criteria-score.score-2 { background: #ff9800; }
.criteria-score.score-3 { background: #2196f3; }
.criteria-score.score-4 { background: #4caf50; }

.criteria-content h4 {
    color: #612ab4;
    font-weight: 600;
    margin-bottom: 5px;
}

.criteria-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 360px) {
    .app-container {
        padding: 12px;
    }
    
    /* .date-btn {
        width: 56px;
        height: 56px;
    } */
    
    .date-number {
        font-size: 20px;
    }
    
    .questions-title {
        font-size: 18px;
    }
    
    .activity-title {
        font-size: 16px;
    }
    
    .score-btn.compact {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
    
    .score-btn.detailed {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Animation for expanding/collapsing */
.activity-content {
    transition: all 0.3s ease;
}

.score-options {
    transition: all 0.3s ease;
}

/* Hide elements smoothly */
.score-options[style*="display: none"] {
    opacity: 0;
    visibility: hidden;
}

.score-options:not([style*="display: none"]) {
    opacity: 1;
    visibility: visible;
}


/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.save-btn.loading {
    background: #666 !important;
}

.save-btn.success {
    background: #4CAF50 !important;
}

.save-btn.error {
    background: #f44336 !important;
}

/* Utility classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }

/* Focus states for accessibility */
.date-btn:focus,
.score-btn:focus,
.help-btn:focus,
.save-btn:focus {
    outline: 1px solid #741afa99;
    outline-offset: 2px;
}



.activities-list:has(.expanded) .activity-card{
    filter: blur(5px);
    opacity: 0.75;
}

.activities-list:has(.expanded) .activity-card.expanded{
    filter: none;
    opacity: 1;
}
