/**
 * Profile Page Styles - Optimized
 * Uses utility classes and CSS variables from main.css
 */

/* Page-specific background */
body {
    background: var(--gray-50) !important;
}

/* Profile Header */
.profile-header {
    background: var(--sobie-gradient);
    color: white;
    padding: var(--space-2xl) 0;
    margin-top: var(--space-xl);
    position: relative;
    overflow: hidden;
}

/* Grid pattern overlay */
.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

.profile-header .container {
    position: relative;
    z-index: 2;
}

/* Profile Photo */
.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    object-fit: cover;
}

.profile-photo-container {
    position: relative;
    display: inline-block;
}

.profile-initials {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Profile Card Enhanced */
.profile-card {
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* Info items styling */
.info-item {
    display: flex;
    align-items: center;
}

.info-group {
    margin-bottom: 1rem;
}

.field-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.info-item i {
    font-size: 1.1rem;
    opacity: 0.8;
    min-width: 24px;
    margin-right: 0.5rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Editable fields styling */
.editable-field {
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
}

.editable-field:hover {
    background: rgba(255,255,255,0.05);
    cursor: pointer;
}

/* Edit mode improvements with gold border */
.info-value.editing {
    background: rgba(255,255,255,0.1);
    border: 2px solid #FFD700 !important; /* Gold border */
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.editable-field.editing {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    background: rgba(255,255,255,0.1);
}

/* Field editing input styles */
.field-edit-input, .field-edit-select {
    background: rgba(255,255,255,0.9);
    border: 2px solid #FFD700;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 1.1rem;
    color: #333;
    width: 100%;
    min-width: 200px;
}

.field-edit-input[type="textarea"], textarea.field-edit-input {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.field-edit-input:focus, .field-edit-select:focus {
    outline: none;
    border-color: #FFA500;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.info-value.empty-field {
    opacity: 0.5;
    font-style: italic;
}
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    object-fit: cover;
}

/* Badges and Role Display */
.badge-role {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Card Components - using optimized variables */
.section-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid color-mix(in srgb, var(--sobie-primary) 10%, transparent);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card-body {
    padding: var(--space-lg);
}

.section-header {
    background: rgba(37, 99, 235, 0.05);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

/* Information Display */
.info-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #475569;
    display: inline;
    margin-right: 0.5rem;
}

.info-label:after {
    content: ':';
}

.info-value {
    color: #1e293b;
    display: inline;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

/* Social Links */
.social-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    margin: 0.25rem 0.25rem 0.25rem 0;
    transition: all 0.2s;
}

.social-link:hover {
    background: var(--sobie-primary);
    color: white;
    transform: translateY(-1px);
}

/* History Items */
.history-item {
    padding: 1rem;
    background: #f8fafc;
    border-left: 3px solid var(--sobie-primary);
    margin-bottom: 0.75rem;
    border-radius: 0 8px 8px 0;
}

/* Interactive Elements */
.privacy-toggle {
    cursor: pointer;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Editing Functionality */
.editing-enabled .info-value {
    cursor: pointer;
}

.editing-enabled .info-value:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.info-value.editing {
    background-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    cursor: text;
}

/* Input Styles */
.edit-input {
    border: 1px solid var(--sobie-primary);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: inherit;
    color: inherit;
    width: 100%;
    max-width: 300px;
}

.edit-input:focus {
    outline: 2px solid var(--sobie-accent);
    border-color: var(--sobie-accent);
}

.field-edit-input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
    width: 100%;
    min-width: 80px;
}

.field-edit-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
    min-width: 100px;
    max-width: 200px;
}

.edit-select {
    border: 1px solid var(--sobie-primary);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: inherit;
    color: inherit;
    max-width: 200px;
}

.other-input {
    margin-top: 0.5rem !important;
    display: block !important;
    font-style: italic;
    border-color: #6c757d !important;
}

.other-input::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

/* Post-nominal Degrees */
.post-nominal-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.post-nominal-badge {
    background: var(--sobie-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.post-nominal-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.post-nominal-remove:hover {
    opacity: 1;
}

.post-nominal-input {
    border: 1px solid #ddd;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 200px;
}

/* Autocomplete */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.autocomplete-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
    background-color: var(--sobie-primary);
    color: white;
}

/* Enhanced Edit Mode Visibility */
.editing-enabled .info-value[data-type="text"],
.editing-enabled .info-value[data-type="email"],
.editing-enabled .info-value[data-type="tel"],
.editing-enabled .info-value[data-type="url"] {
    border: 2px dashed transparent;
    min-height: 1.5rem;
    min-width: 120px;
    display: inline-block;
}

.editing-enabled .info-value[data-type="text"]:hover,
.editing-enabled .info-value[data-type="email"]:hover,
.editing-enabled .info-value[data-type="tel"]:hover,
.editing-enabled .info-value[data-type="url"]:hover {
    border-color: var(--sobie-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.info-value.empty-field {
    color: #999;
    font-style: italic;
    min-width: 100px;
    display: inline-block;
}

.editing-enabled .info-value.empty-field {
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--sobie-primary);
    padding: 4px 8px;
}

.editing-enabled .info-value.empty-field:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

.editing-disabled .info-value {
    cursor: default;
}

.editing-disabled .info-value:hover {
    background-color: transparent;
}

.editing-mode .info-value {
    display: block;
    align-items: flex-start;
}

/* Footer */
.footer-section {
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        max-width: 95% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .section-card {
        margin-bottom: 1.5rem;
    }
    
    .profile-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}