/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #4a5568;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-header p {
    color: #718096;
    font-size: 14px;
}

/* Forms */
.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-save {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.btn-reset {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    margin-left: 10px;
}

/* Links */
.login-links {
    text-align: center;
}

.login-links .link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin: 10px 0;
    transition: color 0.3s ease;
}

.login-links .link:hover {
    color: #764ba2;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    color: #4a5568;
    font-size: 32px;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #718096;
    font-weight: 500;
}

.logout-form {
    margin: 0;
}

.logout-form .btn {
    width: auto;
    padding: 8px 16px;
}

/* Progress Card */
.progress-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.progress-card h2 {
    color: #4a5568;
    font-size: 24px;
    margin-bottom: 10px;
}

.instruction {
    color: #718096;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Progress Grid */
.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chapter-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.chapter-title {
    color: #4a5568;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.lessons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.lesson-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.lesson-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.lesson-label {
    font-size: 16px;
    font-weight: 500;
    color: #4a5568;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.form-actions .btn {
    width: auto;
    min-width: 120px;
}

.save-icon, .reset-icon {
    margin-right: 8px;
}

/* Progress Summary */
.progress-summary {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.progress-summary h3 {
    color: #4a5568;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    color: #718096;
    font-size: 14px;
}

.stat-value {
    color: #4a5568;
    font-size: 24px;
    font-weight: 600;
    margin: 0 5px;
}

.stat-total {
    color: #a0aec0;
    font-size: 16px;
}

/* Progress Bar */
.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #2f855a;
}

/* Reset Result Page */
.reset-result .user-list {
    margin-bottom: 30px;
}

.user-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

.user-id, .password-note {
    margin-bottom: 5px;
    font-size: 14px;
}

.user-id strong, .password-note strong {
    color: #4a5568;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .progress-grid {
        grid-template-columns: 1fr;
    }
    
    .lessons {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 10px;
    }
}