/* CodeKiste Account Management Styles */

.ck-account-dashboard {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.ck-account-header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.ck-user-avatar img {
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
}

.ck-user-summary h2 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: 300;
}

.ck-user-summary h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.ck-school-info,
.ck-role-info {
    margin: 0 0 5px 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Navigation */
.ck-account-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    overflow-x: auto;
}

.ck-nav-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ck-nav-btn:hover {
    color: #495057;
    background: rgba(0,124,186,0.05);
}

.ck-nav-btn.active {
    color: #007cba;
    border-bottom-color: #007cba;
    background: rgba(0,124,186,0.1);
}

/* Content */
.ck-account-content {
    min-height: 400px;
}

.ck-account-section {
    display: none;
    padding: 30px;
}

.ck-account-section.active {
    display: block;
}

.ck-section-content h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.3rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Forms */
.ck-form {
    max-width: 600px;
}

.ck-form-row {
    margin-bottom: 20px;
}

.ck-field {
    margin-bottom: 15px;
}

.ck-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

.ck-field input[type="text"],
.ck-field input[type="email"],
.ck-field input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ck-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.ck-field input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

.ck-field small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* Password field */
.ck-password-field {
    position: relative;
}

.ck-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #6c757d;
    padding: 4px;
}

.ck-password-toggle:hover {
    color: #495057;
}

/* Password strength */
.ck-password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.ck-password-strength::before {
    content: '';
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ck-password-strength.weak::before {
    width: 25%;
    background: #dc3545;
}

.ck-password-strength.fair::before {
    width: 50%;
    background: #ffc107;
}

.ck-password-strength.good::before {
    width: 75%;
    background: #fd7e14;
}

.ck-password-strength.strong::before {
    width: 100%;
    background: #28a745;
}

/* Password requirements */
.ck-password-requirements {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.ck-password-requirements h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #495057;
}

.ck-password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.ck-password-requirements li {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

/* Form actions */
.ck-form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Buttons */
.ck-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    position: relative;
}

.ck-btn-primary {
    background: #007cba;
    color: white;
}

.ck-btn-primary:hover {
    background: #005a87;
}

.ck-btn-secondary {
    background: #6c757d;
    color: white;
}

.ck-btn-secondary:hover {
    background: #545b62;
}

.ck-btn-danger {
    background: #dc3545;
    color: white;
}

.ck-btn-danger:hover {
    background: #c82333;
}

.ck-btn-link {
    background: transparent;
    color: #007cba;
    border: 1px solid #007cba;
}

.ck-btn-link:hover {
    background: #007cba;
    color: white;
}

.ck-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ck-btn.loading .ck-btn-text {
    display: none;
}

.ck-btn.loading .ck-btn-loading {
    display: inline;
}

.ck-btn-loading {
    display: none;
}

/* Messages */
.ck-messages {
    margin-top: 20px;
}

.ck-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid;
}

.ck-message.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.ck-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.ck-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Settings section */
.ck-setting-item {
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.ck-setting-item:last-child {
    border-bottom: none;
}

.ck-setting-item h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.1rem;
}

.ck-setting-item p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}

/* Stats grid */
.ck-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.ck-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.ck-stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.ck-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

/* Danger zone */
.ck-danger-zone {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.ck-warning {
    margin-bottom: 20px;
}

.ck-warning h4 {
    color: #c53030;
    margin: 0 0 10px 0;
}

.ck-warning p {
    color: #744210;
    margin: 0 0 10px 0;
}

.ck-warning ul {
    color: #744210;
    margin: 0;
    padding-left: 20px;
}

.ck-warning li {
    margin-bottom: 4px;
}

/* Error styling */
.ck-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 15px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .ck-account-dashboard {
        margin: 10px;
        border-radius: 0;
    }
    
    .ck-account-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .ck-account-nav {
        flex-wrap: wrap;
    }
    
    .ck-nav-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .ck-account-section {
        padding: 20px;
    }
    
    .ck-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ck-account-header {
        padding: 15px;
    }
    
    .ck-account-section {
        padding: 15px;
    }
    
    .ck-nav-btn {
        font-size: 12px;
        padding: 12px 15px;
    }
}

/* Focus states for accessibility */
.ck-nav-btn:focus,
.ck-btn:focus,
.ck-field input:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Loading animation */
@keyframes ck-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ck-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: ck-spin 1s linear infinite;
    margin-right: 8px;
}