/* Family Quest - Styles */

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

:root {
    --primary: #4CAF50;
    --secondary: #2196F3;
    --accent: #FF9800;
    --danger: #F44336;
    --success: #8BC34A;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
}

#app {
    min-height: 100vh;
}

/* Header Styles */
.header {
    background-color: var(--primary);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header.parent {
    background-color: var(--primary);
}

.header.child {
    background-color: var(--accent);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Main Menu */
.main-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.main-menu h1 {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.main-menu h2 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.menu-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 30px 60px;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.menu-btn.parent {
    background: var(--secondary);
}

.menu-btn.child {
    background: var(--accent);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background: var(--secondary);
    padding: 20px 0;
}

.sidebar-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-btn:hover,
.sidebar-btn.active {
    background: rgba(255,255,255,0.1);
}

.content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: bold;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Quest Item */
.quest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #eee;
}

.quest-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.quest-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.quest-points {
    color: var(--accent);
    font-weight: bold;
}

/* Child Profile */
.child-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 10px;
}

.child-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.child-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Story Widget */
.story-widget {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid var(--secondary);
}

.story-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.story-info {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Rating Stars */
.rating-container {
    display: flex;
    align-items: center;
    margin: 8px 0;
    flex-wrap: wrap;
    gap: 5px;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star {
    font-size: 24px;
    transition: all 0.2s ease;
    user-select: none;
    cursor: pointer !important;
    color: #ddd !important;
    opacity: 1;
}

.star::before {
    content: '★';
}

.star:hover {
    transform: scale(1.2);
    color: #FFD700 !important;
    opacity: 1;
    filter: drop-shadow(0 0 3px #FFD700);
}

.star.active {
    color: #FFD700 !important;
    opacity: 1;
}

.star.hover-active {
    color: #FFD700 !important;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .content {
        padding: 20px;
    }
    
    .menu-buttons {
        flex-direction: column;
    }
    
    .menu-btn {
        width: 100%;
    }
}
