:root {
    /* Color Tokens */
    --color-white: #FFFFFF;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-teal-500: #14B8A6;
    --color-teal-600: #0D9488;
    --color-red-500: #EF4444;
    --color-orange-500: #F97316;
    
    /* RGB version for RGBA usage */
    --color-teal-500-rgb: 20, 184, 166;

    /* Semantic Colors */
    --color-background: var(--color-gray-100);
    --color-surface: var(--color-white);
    --color-text: var(--color-gray-800);
    --color-text-secondary: var(--color-gray-700);
    --color-primary: var(--color-teal-500);
    --color-primary-hover: var(--color-teal-600);
    --color-border: var(--color-gray-200);
    --color-error: var(--color-red-500);
    --color-warning: var(--color-orange-500);

    /* Typography */
    --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* Spacing & Sizing */
    --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-20: 20px; --space-24: 24px;

    /* Border Radius & Shadows */
    --radius-base: 8px; --radius-lg: 12px; --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --duration-fast: 150ms;
}

/* Base styles */
body {
    margin: 0;
    font-family: var(--font-family-base);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--font-weight-semibold); }
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
p { margin: 0; line-height: 1.6; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* Layout */
.container { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 var(--space-16); }
.app-header { background-color: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-content { display: flex; justify-content: space-between; align-items: center; padding: var(--space-12) 0; }
.header-left { display: flex; align-items: center; gap: var(--space-16); }
.app-logo h1 { font-size: var(--font-size-2xl); color: var(--color-primary); }
.main-content { padding: var(--space-24) 0; }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

/* Shared Icon Button and Dropdown Styles */
.icon-btn {
    background: none;
    border: none;
    padding: var(--space-8);
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover {
    background-color: var(--color-gray-100);
}
.icon-btn svg {
    width: 24px;
    height: 24px;
    color: var(--color-gray-700);
}

/* *** NEW STYLE FOR BACK BUTTON *** */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8); /* Same padding as icon-btn */
    border-radius: var(--radius-full);
    text-decoration: none; /* Remove underline from link */
    transition: background-color var(--duration-fast);
}
.back-button:hover {
    background-color: var(--color-gray-100);
    text-decoration: none; /* Keep underline off on hover */
}
.back-button svg {
    width: 24px;
    height: 24px;
    color: var(--color-gray-700);
}
/* *** END NEW STYLE *** */

.options-menu {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 110;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-12);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-size-base);
}
.dropdown-item:hover {
    background-color: var(--color-gray-100);
}
.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--color-gray-700);
}

/* Side Navigation */
.main-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 280px;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 300ms ease-in-out;
    z-index: 200;
    display: flex;
    flex-direction: column;
}
.main-nav.show {
    transform: translateX(0);
}
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-16) var(--space-24);
    border-bottom: 1px solid var(--color-border);
}
.nav-header h3 {
    color: var(--color-primary);
}
.main-nav .nav-links {
    list-style: none;
    padding: var(--space-16);
    margin: 0;
}
.main-nav .nav-links a {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-12);
    border-radius: var(--radius-base);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-8);
}
.main-nav .nav-links a:hover, .main-nav .nav-links a.active {
    background-color: var(--color-gray-100);
    text-decoration: none;
}
.nav-links a svg {
    width: 20px;
    height: 20px;
}
.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 199;
}

/* Section Management */
.section-content {
    display: none;
}
.section-content.active {
    display: block;
}

.sphere-hub-post {
    background-color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    margin-bottom: var(--space-16);
    border: 1px solid var(--color-border);
}

/* Notification Specific Styles */
.notification-bell {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--color-error);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid var(--color-surface);
}

#notifications-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}
.notification-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    cursor: pointer;
    transition: box-shadow var(--duration-fast);
}
.notification-card:hover {
    box-shadow: var(--shadow-md);
}
.notification-card.unread {
    border-left: 4px solid var(--color-primary);
}
.notification-card .message {
    margin-bottom: var(--space-8);
    color: var(--color-text);
}
.notification-card .message img {
    max-width: 100%;
    border-radius: var(--radius-base);
    margin-top: var(--space-8);
}
.notification-card .timestamp {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Card & Profile */
.profile-section { display: grid; gap: var(--space-24); }
.card { 
    background-color: var(--color-surface); 
    border-radius: var(--radius-lg); 
    border: 1px solid var(--color-border); 
    box-shadow: var(--shadow-sm); 
    overflow: hidden;
}

.profile-header .card-content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-16); padding: var(--space-24); }

.profile-image-wrapper {
    position: relative;
    width: 104px;
    height: 104px;
}
.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-surface);
    box-shadow: 0 0 0 4px var(--color-primary);
}
.upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast);
}
.upload-btn:hover {
    transform: scale(1.1);
}
.upload-btn svg {
    width: 16px;
    height: 16px;
}

.profile-info { flex-grow: 1; }
.profile-info h2 { margin-bottom: var(--space-4); }
.profile-title, .profile-location { color: var(--color-text-secondary); margin-top: var(--space-4); }
.section-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-16); border-bottom: 1px solid var(--color-border); }
.card-body { padding: var(--space-20); }
.info-item { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-8) 0; }
.info-icon { width: 20px; height: 20px; color: var(--color-primary); flex-shrink: 0; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-16); }
.stat-card { padding: var(--space-20); border-radius: var(--radius-base); text-align: center; background-color: var(--color-background); }
.stat-card h4 { font-size: var(--font-size-3xl); color: var(--color-primary); margin-bottom: var(--space-4); }

.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: var(--space-12); border-bottom: 1px solid var(--color-border); }
.hours-table td:first-child { font-weight: var(--font-weight-medium); }

.services-list, .keywords-list { /* Added keywords-list */
    list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-8); 
}
.service-tag, .keyword-tag { /* Added keyword-tag */
    background-color: rgba(var(--color-teal-500-rgb), 0.1); 
    color: var(--color-teal-600); 
    padding: var(--space-4) var(--space-12); 
    border-radius: var(--radius-full); 
    font-size: var(--font-size-sm); 
}

.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-12); }
.gallery-img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-base); }

.gallery-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-12);
}
.gallery-management-item {
    position: relative;
}
.gallery-management-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-base);
}
.gallery-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); padding: var(--space-8) var(--space-16); border-radius: var(--radius-base); font-weight: var(--font-weight-medium); cursor: pointer; transition: background-color var(--duration-fast); border: 1px solid transparent; text-align: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover:not(:disabled) { background-color: var(--color-primary-hover); }
.btn-secondary { background-color: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background-color: var(--color-gray-100); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background-color: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: var(--space-16); }
.modal-content { background-color: var(--color-surface); border-radius: var(--radius-lg); width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-16); border-bottom: 1px solid var(--color-border); }
.close-btn { background: none; border: none; cursor: pointer; padding: var(--space-4); }
.modal-body { padding: var(--space-20); max-height: 70vh; overflow-y: auto; }
.form-actions { display: flex; gap: var(--space-12); justify-content: flex-end; margin-top: var(--space-24); }
.form-group { margin-bottom: var(--space-16); }
.form-group label { display: block; margin-bottom: var(--space-8); font-weight: var(--font-weight-medium); }
.form-control { display: block; width: 100%; padding: var(--space-8) var(--space-12); border: 1px solid var(--color-border); border-radius: var(--radius-base); }

@media (min-width: 768px) {
    .profile-header .card-content {
        flex-direction: row;
        text-align: left;
        gap: var(--space-20);
    }
    .profile-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-24);
    }
    .profile-header, .full-width-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    /* *** ADJUSTED: Reduced gap for back button *** */
    .header-left { gap: var(--space-8); } 
    .header-left h1 { display: none; }
    .btn { padding: var(--space-8) var(--space-12); font-size: var(--font-size-base); }
    .section-header { flex-direction: column; align-items: flex-start; gap: var(--space-12); }
}