/* tutor-profile-page.css */

.profile-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333; /* Or use var(--dark) */
}

/* Loading / Messages */
#loading-indicator {
    color: #555;
}
/* Use form-message styles from auth.css or style.css if defined */
.form-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}
.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}


/* Profile Sections */
.profile-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}
.profile-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.profile-section h2 {
    font-size: 1.4rem;
    color: #4CAF50; /* Or use var(--primary) */
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 2px solid #4CAF50; /* Or use var(--primary) */
    display: inline-block;
}

/* Field Styling */
.field-group {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    align-items: flex-start; /* Align label top */
}

.field-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    flex-basis: 200px; /* Fixed width for labels */
    flex-shrink: 0;
    padding-right: 15px; /* Space between label and value/input */
}

.field-group .view-mode,
.field-group .edit-mode {
    flex-grow: 1; /* Take remaining space */
    min-width: 200px; /* Prevent excessive squishing */
}

.field-group .view-mode {
    line-height: 1.6;
    word-break: break-word; /* Allow long text to wrap */
    padding-top: 2px; /* Align better with inputs */
}
.view-mode-textarea {
    white-space: pre-wrap; /* Respect line breaks in textarea view */
}

/* Hiding/Showing Edit/View Modes */
.edit-mode {
    display: none; /* Hide edit fields by default */
}

.profile-container.edit-active .view-mode {
    display: none; /* Hide view spans when editing */
}

.profile-container.edit-active .edit-mode {
    display: block; /* Show edit fields when editing */
    width: 100%; /* Ensure inputs take full width in their container */
}
/* Specific display for flex/grid items in edit mode */
.profile-container.edit-active .edit-mode.checkbox-group,
.profile-container.edit-active .edit-mode .checkbox-columns,
.profile-container.edit-active .edit-mode .checkbox-grid {
     display: block; /* Or flex/grid as appropriate */
}
.profile-container.edit-active .edit-mode .checkbox-columns { display: flex; gap: 20px; }
.profile-container.edit-active .edit-mode .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;}


/* Edit Mode Inputs (Inherit from style.css or auth.css if possible) */
.edit-mode input[type="text"],
.edit-mode input[type="email"],
.edit-mode input[type="tel"],
.edit-mode select,
.edit-mode textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}
.edit-mode textarea {
    min-height: 100px;
    resize: vertical;
}
.edit-mode input:focus,
.edit-mode select:focus,
.edit-mode textarea:focus {
     outline: none;
    border-color: #4CAF50; /* Or use var(--primary) */
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}
.edit-mode input:disabled {
    background-color: #eee;
    cursor: not-allowed;
}
.edit-mode small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #777;
}


/* Checkbox Styling (similar to create-tutor-profile.css) */
.checkbox-group legend {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.checkbox-group fieldset {
    border: none;
    padding: 0;
    margin: 0 0 10px 0;
}
.checkbox-group div {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: auto; /* Override default */
    flex-shrink: 0;
}
.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    flex-grow: 1;
    /* Reset field-group label properties */
    flex-basis: auto;
    padding-right: 0;
    color: #333;
    font-size: 0.95rem;
}


/* Profile Picture Specific Styles */
.profile-picture-section .field-group {
    align-items: center; /* Vertically align image/inputs */
}
.profile-pic-view {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
}
.profile-pic-edit-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    margin-top: 10px;
    display: block; /* Ensure margin works */
}

/* Action Buttons */
.profile-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}
.profile-actions .btn {
    margin-left: 10px;
}
.profile-actions .btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}
.profile-actions .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .field-group {
        flex-direction: column; /* Stack label and value/input */
        align-items: stretch; /* Stretch to full width */
    }
    .field-group label {
        flex-basis: auto; /* Reset fixed basis */
        margin-bottom: 8px; /* Increase space below label */
        padding-right: 0;
    }
     .checkbox-columns {
        flex-direction: column;
        gap: 0;
    }
    .profile-actions {
        text-align: center;
    }
    .profile-actions .btn {
        display: block;
        width: 100%;
        margin: 10px 0 0 0;
    }
     .profile-actions #save-loading-indicator {
        margin: 10px auto 0 auto;
        display: none; /* Ensure it's hidden */
        text-align: center;
    }
     .profile-actions .btn-secondary { /* Ensure cancel is full width too */
        margin-top: 10px;
    }

}
