/* My Account Styles */

#my-account-container {  }

/* Call to Action Styles for Non-logged-in Users */
.account-cta-box {
    background: linear-gradient(135deg, #ea4435 0%, #ffd052 100%);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.cta-content {
    max-width: 500px;
    margin: 0 auto;
}

.cta-icon {
    margin-bottom: 20px;
    opacity: 0.9;
}

.cta-icon svg {
    width: 64px;
    height: 64px;
    color: white;
}

.account-cta-box h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cta-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.cta-section h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.cta-divider {
    margin: 30px 0;
    position: relative;
}

.cta-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.cta-divider span {
    background: linear-gradient(135deg, #ea4435 0%, #ffd052 100%);
    padding: 0 20px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background: #ea4435;
    color: white;
    box-shadow: 0 4px 15px rgba(234, 68, 53, 0.3);
}

.btn-primary:hover {
    background: #d73925;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 68, 53, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-reactivate {
    background: #ff6b6b;
    color: white;
    margin-top: 15px;
}

.btn-reactivate:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-change-grades {
    background: #ffd052;
    color: #000000;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-change-grades:hover {
    background: #ffcd3d;
}

.btn-save {
    padding: 15px 40px;
    font-size: 1.1rem;
    margin-top: 20px;
}

/* Membership Status Section */
.membership-status-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
}

.membership-status-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #000000;
    font-weight: 600;
}

.status-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    border-left: 5px solid #ea4435;
}

.status-info.expired {
    border-left-color: #ea4435;
}

.status-info.inactive {
    border-left-color: #ea4435;
}

.status-info.lifetime {
    border-left-color: #ffd052;
}

.status-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000000;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #ffd052 0%, #ff8c00 50%, #ea4435 100%); /* Colorful background represents total time */
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    position: relative;
}

/* Progress bar represents REMAINING subscription time */
.progress-fill {
    height: 100%;
    background: #e9ecef; /* Gray represents consumed/elapsed time */
    border-radius: 6px;
    transition: width 0.3s ease;
    position: absolute;
    right: 0; /* Fill from right side to show consumed time */
}

/* Active subscription - colorful background with gray fill showing consumed time */
.status-info.active .progress-bar {
    background: linear-gradient(90deg, #ffd052 0%, #ff8c00 50%, #ea4435 100%);
}

.status-info.active .progress-fill {
    background: #e9ecef; /* Gray shows consumed time */
}

/* Expired subscriptions show full gray (no remaining time) */
.status-info.expired .progress-bar {
    background: #e9ecef;
}

.status-info.expired .progress-fill {
    background: #e9ecef;
    width: 100%; /* Full gray when expired */
}

.status-info.inactive .progress-bar {
    background: #e9ecef;
}

.status-info.inactive .progress-fill {
    background: #e9ecef;
    width: 100%; /* Full gray when inactive */
}

/* Lifetime subscriptions show full gold (no consumed time) */
.status-info.lifetime .progress-bar {
    background: linear-gradient(90deg, #ffd052 0%, #ffcd3d 100%);
}

.status-info.lifetime .progress-fill {
    background: transparent; /* No consumed time for lifetime */
    width: 0%;
}

.status-text {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 10px;
}

/* Profile Edit Section */
.profile-edit-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
}

.profile-edit-section h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #000000;
    font-weight: 600;
}

.profile-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #000000;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #ea4435;
    box-shadow: 0 0 0 3px rgba(234, 68, 53, 0.1);
}

.form-group input.readonly {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Grades Display */
.grades-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.current-grades {
    font-weight: 500;
    color: #000000;
}

.no-grades-available {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
}

/* Teachers Section */
.teachers-section .teachers-list {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: white;
    max-height: 300px;
    overflow-y: auto;
}

.teacher-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.3s ease;
}

.teacher-item:hover {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 12px 8px;
}

.teacher-item.connected {
    background-color: #f0f9ff;
}

.teacher-item:last-child {
    border-bottom: none;
}

.teacher-name {
    font-weight: 500;
    color: #000000;
}

.no-teachers {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 12px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #ea4435;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.profile-form.has-changes .btn-save {
    background: #ffd052;
    color: #000000;
    animation: pulse 2s infinite;
}

.profile-form.has-changes .btn-save:hover {
    background: #ffcd3d;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 208, 82, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 208, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 208, 82, 0); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #000000;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
}

/* Grade Selection */
.grades-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.grade-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grade-option:hover {
    border-color: #ea4435;
    background: #fff5f5;
}

.grade-option input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.grade-option input:checked + .grade-label {
    color: #ea4435;
    font-weight: 600;
}

.grade-label {
    font-size: 0.95rem;
    color: #000000;
    transition: color 0.3s ease;
}

/* Error Messages */
.account-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    text-align: center;
    font-weight: 500;
}

/* Success Messages */
.account-success {
    background: #dcfce7;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    text-align: center;
    font-weight: 500;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #my-account-container {
        padding: 15px;
    }
    
    .account-cta-box {
        padding: 40px 20px;
    }
    
    .account-cta-box h2 {
        font-size: 2rem;
    }
    
    .membership-status-section,
    .profile-edit-section {
        padding: 20px;
    }
    
    .grades-display {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .grades-selection {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .account-cta-box h2 {
        font-size: 1.8rem;
    }
    
    .cta-section {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Animation for smooth transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.membership-status-section,
.profile-edit-section {
    animation: fadeInUp 0.5s ease-out;
}

/* Focus management for accessibility */
.btn:focus,
input:focus,
.toggle-switch input:focus + .toggle-slider {
    outline: 2px solid #ea4435;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .modal-overlay,
    .btn {
        display: none !important;
    }
    
    #my-account-container {
        box-shadow: none;
    }
}
