/* admin/edit_user.css - Centered Profile Picture */
:root {
    --admin-primary: #0b5e2a;
    --admin-primary-light: #29a220;
    --admin-secondary: #2e7d32;
    --admin-danger: #d32f2f;
    --admin-warning: #f57c00;
    --admin-info: #0288d1;
    --admin-light: #f8fafc;
    --admin-dark: #1e293b;
    --admin-accent: #7e57c2;
    --admin-gray: #64748b;
    --admin-border: #e2e8f0;
    --admin-bg: #f1f5f9;
    --admin-card-bg: #ffffff;
    --admin-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.edit-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

/* Centered Container */
.edit-container-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

/* Modern Card Design */
.edit-card {
    background: var(--admin-card-bg);
    border-radius: 20px;
    box-shadow: var(--admin-shadow);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-accent) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.admin-header p {
    opacity: 0.9;
    font-size: 0.95rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    margin-bottom: 0;
}

.back-button {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

/* Card Body */
.card-body {
    padding: 35px;
}

/* Centered Profile Section */
.profile-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-avatar-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

/* Centered Profile Avatar */
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--admin-primary);
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.8rem;
    position: relative;
    transition: all 0.3s ease;
    /* Ensure images are properly contained and centered */
    object-position: center;
    overflow: hidden;
    margin: 0 auto;
}

/* Style for when there's an actual image - ensures centered circle */
.profile-avatar.has-image {
    background: none;
    border: 3px solid var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(26, 75, 140, 0.3);
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    text-align: center;
}

.upload-info {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

.upload-info h4 {
    color: var(--admin-dark);
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-info p {
    color: var(--admin-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.upload-btn {
    background: var(--admin-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    background: var(--admin-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 75, 140, 0.3);
}

.upload-btn input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.file-input-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--admin-dark);
    font-size: 0.95rem;
    line-height: 1.4;
}

.form-label.required::after {
    content: " *";
    color: var(--admin-danger);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--admin-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--admin-light);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 75, 140, 0.1);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--admin-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--admin-light);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 18px;
    line-height: 1.5;
}

.form-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(26, 75, 140, 0.1);
}

/* Enhanced Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--admin-light);
    border-radius: 10px;
    border: 1px solid var(--admin-border);
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid var(--admin-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-check-input:checked {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.form-check-input:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.form-check-label {
    font-weight: 500;
    color: var(--admin-dark);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

/* Enhanced Registration Info */
.registration-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 25px;
}

.registration-info h6 {
    color: var(--admin-primary);
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.registration-info p {
    color: var(--admin-gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Enhanced Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid transparent;
    line-height: 1.5;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.alert i {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

/* Enhanced Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 75, 140, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 75, 140, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--admin-dark);
    border: 2px solid var(--admin-border);
}

.btn-secondary:hover {
    background: var(--admin-light);
    border-color: var(--admin-gray);
    transform: translateY(-2px);
}

/* Form Text & Helpers */
.form-text {
    font-size: 0.85rem;
    color: var(--admin-gray);
    margin-top: 8px;
    line-height: 1.5;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .edit-container-wrapper {
        max-width: 100%;
    }
    
    .card-body {
        padding: 30px 25px;
    }
    
    .admin-header {
        padding: 25px;
    }
    
    .admin-header h1 {
        font-size: 1.4rem;
    }
    
    .profile-avatar {
        width: 90px;
        height: 90px;
        font-size: 1.6rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body.edit-container {
        padding: 15px;
    }
    
    .card-body {
        padding: 25px 20px;
    }
    
    .admin-header {
        padding: 20px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.4rem;
    }
    
    .form-control, .form-select {
        padding: 12px 14px;
    }
    
    .btn {
        padding: 14px 20px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}