/*
Theme Name: Hip App Theme V3
Description: Professional App Theme - Fixed Layout & PWA
Version: 3.7.1
Author: Hip Medya
Text Domain: hip-app
*/

/* =========================================
   VARIABLES
   ========================================= */
:root {
    --header-h: 70px;
    --primary: #4F46E5;
    --primary-hover: #4338ca;
    
    /* Light Theme (Default) */
    --bg-body: #F3F4F6;
    --bg-header: #ffffff;
    --text-main: #1F2937;
    --text-sub: #6B7280;
    --border: #E5E7EB;
    --input-bg: #F9FAFB;
    --hover-bg: #F9FAFB;
    --dropdown-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --overlay-bg: rgba(0, 0, 0, 0.5);
    
    --radius: 8px;
    --radius-lg: 16px;
    --bg-surface: #ffffff;
}

[data-theme="dark"] {
    --bg-body: #111827;
    --bg-header: #1F2937;
    --text-main: #F9FAFB;
    --text-sub: #9CA3AF;
    --border: #374151;
    --input-bg: #1F2937;
    --hover-bg: #374151;
    --dropdown-bg: #1F2937;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --bg-surface: #1F2937;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    padding-top: var(--header-h);
}

/* Auth sayfaları için özel body ayarı (header yoksa) */
body.login-page, body.register-page {
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

/* Utilities */
.desktop-only { display: flex !important; }
.mobile-only { display: none !important; }

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
}

/* =========================================
   HEADER LAYOUT
   ========================================= */
.header {
    height: var(--header-h);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 999999;
    transition: background-color 0.3s, border-color 0.3s;
    box-shadow: var(--shadow);
}

.header-left, .header-right {
    display: flex; align-items: center; height: 100%;
}
.header-right { gap: 1px; }

/* Logo */
.logo {
    font-size: 1.25rem; font-weight: 800; color: var(--text-main);
    text-decoration: none; display: flex; align-items: center; gap: 10px;
    margin-right: 24px; letter-spacing: -0.5px;
}
.logo i { color: var(--primary); font-size: 1.4rem; }
.logo img { max-height: 40px; width: auto; }

.v-divider {
    width: 1px; height: 32px; background-color: var(--border);
    margin-right: 12px;
}

/* =========================================
   MAIN MENU (DESKTOP)
   ========================================= */
.nav-menu { display: flex; gap: 4px; height: 100%; }
.nav-list-primary { display: flex; gap: 0px; height: 100%; align-items: center; margin: 0; padding: 0; }

.nav-list-primary > li {
    position: relative;
    height: 100%;
    display: flex; align-items: center;
}

.nav-list-primary > li > a {
    padding: 8px 14px; border-radius: 6px;
    color: var(--text-sub); font-weight: 500; font-size: 0.9rem;
    transition: all 0.2s; display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}

.nav-list-primary > li > a:hover, 
.nav-list-primary > li.current-menu-item > a {
    background-color: var(--hover-bg); color: var(--text-main);
}
.nav-list-primary i.menu-icon { font-size: 1rem; color: inherit; opacity: 0.8; }

/* Submenu Fix */
.nav-list-primary .sub-menu {
    position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: var(--dropdown-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 8px; min-width: 220px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: 0.2s; z-index: 9999;
}
.nav-list-primary li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-list-primary .sub-menu li { width: 100%; display: block; margin: 0; }
.nav-list-primary .sub-menu li a {
    display: flex; width: 100%; padding: 10px 12px; border-radius: 8px;
    color: var(--text-main); font-size: 0.875rem;
}
.nav-list-primary .sub-menu li a:hover { background-color: var(--hover-bg); color: var(--primary); }

/* =========================================
   HEADER ICONS
   ========================================= */
.hipapp-icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub); background: transparent; border: none;
    cursor: pointer; font-size: 1.1rem; transition: all 0.2s;
    position: relative; margin: 0;
}
.hipapp-icon-btn:hover { background-color: var(--hover-bg); color: var(--text-main); }
.badge-dot {
    position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; 
    background-color: #EF4444; border-radius: 50%; border: 2px solid var(--bg-header);
}

/* Right Icon Menu */
.nav-list-icons { display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-list-icons > li { display: flex; align-items: center; }
.nav-list-icons > li > a {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub); background: transparent; 
    font-size: 1.1rem; transition: all 0.2s;
}
.nav-list-icons > li > a:hover { background-color: var(--hover-bg); color: var(--text-main); }
.nav-list-icons > li.current-menu-item > a { color: var(--primary); background-color: var(--hover-bg); }
.nav-list-icons > li > a i.menu-icon { font-size: 1.1rem; color: inherit; margin: 0; }

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}

/* =========================================
   SEARCH BOX
   ========================================= */
.search-box {
    display: flex; align-items: center; background: var(--hover-bg);
    border: 1px solid transparent; border-radius: 8px;
    padding: 0 12px; height: 38px; width: 38px; overflow: hidden;
    transition: width 0.3s, border-color 0.3s; cursor: pointer; margin-right: 4px;
}
.search-box:focus-within { width: 240px; border-color: var(--primary); background: var(--bg-header); cursor: text; }
.search-box i { color: var(--text-sub); font-size: 1rem; flex-shrink: 0; margin-right: 8px; }
.search-box form { display: flex; flex: 1; height: 100%; align-items: center; }
.search-box input {
    border: none; background: transparent; height: 100%; width: 100%;
    color: var(--text-main); font-size: 0.9rem; padding: 0;
}

/* =========================================
   PROFILE (HEADER)
   ========================================= */
.profile-wrapper { position: relative; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border); }
.profile-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 30px; }
.profile-btn:hover { background-color: var(--hover-bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-header); box-shadow: 0 0 0 1px var(--border); }

.user-info-box { display: flex; flex-direction: column; justify-content: center; line-height: 1.3; text-align: left; }

/* FIX: Scoped to .user-info-box to prevent conflict with profile page */
.user-info-box .user-name { font-weight: 600; color: var(--text-main); font-size: 0.85rem; margin: 0; }
.user-info-box .user-role { font-size: 0.75rem; color: var(--text-sub); margin: 0; display: block; }

.profile-menu {
    position: absolute; top: calc(100% + 12px); right: 0;
    background: var(--dropdown-bg); border: 1px solid var(--border);
    border-radius: 12px; width: 220px; padding: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: 0.2s; z-index: 9999;
}
.profile-wrapper.active .profile-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-main); font-size: 0.875rem; }
.dropdown-item:hover { background-color: var(--hover-bg); color: var(--primary); }
.menu-divider { height: 1px; background: var(--border); margin: 6px 0; }
.danger { color: #EF4444 !important; }

/* =========================================
   PWA TOAST (FIXED VISIBILITY)
   ========================================= */
.pwa-toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 16px; width: 90%; max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.04);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    z-index: 99999; /* En üstte olması için arttırıldı */
    opacity: 0; visibility: hidden; 
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.pwa-toast.show { 
    opacity: 1; visibility: visible; 
    transform: translateX(-50%) translateY(0); /* Düzgün slide-up efekti */
}

.pwa-content { display: flex; align-items: center; gap: 12px; flex: 1; }
.pwa-icon { border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.5rem; }
.pwa-text { display: flex; flex-direction: column; }
.pwa-text strong { font-size: 0.95rem; color: var(--text-main); }
.pwa-text span { font-size: 0.8rem; color: var(--text-sub); margin-top: 2px; }

.pwa-actions { display: flex; gap: 8px; }
.btn-install { background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.btn-dismiss { background: transparent; color: var(--text-sub); border: none; padding: 8px; font-size: 0.85rem; cursor: pointer; }

/* =========================================
   MOBILE DRAWER & ICONS (REVISED)
   ========================================= */
.mobile-toggle { display: none; margin-left: 8px; font-size: 1.25rem; color: var(--text-main); cursor: pointer; background: transparent; border: none; }
.mobile-drawer-overlay { position: fixed; inset: 0; background: var(--overlay-bg); z-index: 1001; opacity: 0; visibility: hidden; transition: 0.3s; }
.mobile-drawer-overlay.active { opacity: 1; visibility: visible; }

.mobile-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 280px; background: var(--bg-header);
    z-index: 1002; transform: translateX(100%); transition: 0.3s; display: flex; flex-direction: column;
    padding: 24px; border-left: 1px solid var(--border);
}
.mobile-drawer.active { transform: translateX(0); }

.mobile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.close-btn { background: none; border: none; cursor: pointer; font-size: 1.5rem; color: var(--text-main); padding: 4px; display: flex; align-items: center; justify-content: center; }

/* 1. Mobile Quick Actions Grid (Icons Side-by-Side) */
.mobile-quick-actions {
    display: grid; 
    grid-template-columns: repeat(5, 1fr); /* 5 ikon yan yana sığar */
    gap: 8px;
    margin-bottom: 20px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid var(--border);
}

/* Ortak Stil: Hem statik butonlar hem dinamik menü öğeleri için */
.mobile-hipapp-icon-btn, 
.mobile-icons-row li a {
    aspect-ratio: 1; /* Kare */
    width: 100%; 
    height: auto;
    background: var(--hover-bg); 
    border: 1px solid var(--border);
    border-radius: 12px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    color: var(--text-main); 
    cursor: pointer;
    font-size: 0; /* İsimleri gizle */
    padding: 0;
    margin: 0;
    min-width: 0; /* Flex shrink önlemek için */
}

.mobile-hipapp-icon-btn i, 
.mobile-icons-row li a i,
.mobile-icons-row li a i.menu-icon {
    font-size: 1.2rem; 
    color: var(--primary); 
    margin: 0;
    width: auto;
    height: auto;
}

/* Statik butonların text'ini span içine alıp gizle */
.mobile-hipapp-icon-btn span { display: none; }

/* Dinamik Menü Kapsayıcısı (Grid'e dahil etmek için display:contents) */
.mobile-right-menu-items { display: contents; }
.mobile-icons-row { display: contents; list-style: none; margin: 0; padding: 0; }
.mobile-icons-row li { display: contents; } /* Grid hücresi olması için */

/* 2. Mobile Nav List Fixes */
.mobile-nav-content { flex: 1; overflow-y: auto; }
.mobile-nav-list, .mobile-nav-list ul { margin: 0; padding: 0; list-style: none; }
.mobile-nav-list > li { margin-bottom: 2px; }

.mobile-nav-list > li > a {
    display: flex; align-items: center; gap: 12px; padding: 12px; 
    color: var(--text-main); font-weight: 600; border-radius: 8px;
    text-decoration: none;
}
.mobile-nav-list > li > a:hover { background: var(--hover-bg); }
.mobile-nav-list i.menu-icon { width: 24px; text-align: center; color: var(--primary); margin: 0; }

/* Alt Menüler */
.mobile-nav-list ul.sub-menu {
    background: rgba(0,0,0,0.02); margin-top: 4px; border-radius: 8px;
    padding: 4px 0;
}
.mobile-nav-list ul.sub-menu li a {
    padding: 10px 12px 10px 48px; /* Girintili */
    font-size: 0.9rem; color: var(--text-sub);
    font-weight: 500;
}

/* Mobile Search Box */
.mobile-search-box {
    margin: 0 0 20px 0; padding: 0 12px; height: 44px; background-color: var(--hover-bg);
    border-radius: 8px; display: flex; align-items: center; border: 1px solid var(--border);
}
.mobile-search-box input { border: none; background: transparent; height: 100%; width: 100%; margin-left: 10px; color: var(--text-main); font-size: 1rem; }

/* Responsive */
@media (max-width: 1024px) {
    .nav-menu, .v-divider, .profile-arrow, .search-box.desktop-only, .icon-menu-right, .lang-wrapper { display: none !important; }
    .mobile-toggle { display: block; }
    .profile-wrapper { border: none; margin-left: 0; padding-left: 0; }
    .profile-btn { padding: 0; }
    .profile-btn .user-info-box { display: none; }
    .profile-menu { display: none; }
}

/* Lang Menu Desktop */
.lang-wrapper { position: relative; }
.lang-menu {
    position: absolute; top: calc(100% + 12px); right: 0;
    background: var(--dropdown-bg); border: 1px solid var(--border);
    border-radius: 12px; min-width: 120px; padding: 6px;
    box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: 0.2s; z-index: 101;
}
.lang-wrapper.active .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-item { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-main); font-size: 0.85rem; }
.lang-item:hover { background-color: var(--hover-bg); color: var(--primary); }

/* =========================================
   FOOTER STYLES (Fixed & Dynamic)
   ========================================= */
.site-footer {
    background-color: var(--bg-footer);
    border-top: 1px solid var(--border);
    padding-top: 64px;
    padding-bottom: 32px;
    margin-top: auto;
}

/* CONTAINER FIX: İçeriği ortala ve sınırla */
.container {
    max-width: 1280px; /* Geniş ekranlar için ideal */
    width: 100%;
    margin: 0 auto;
    padding: 0 24px; /* Kenar boşluğu */
}

/* Footer Grid */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

/* Brand Column */
.brand-col { display: flex; flex-direction: column; gap: 24px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; color: var(--text-main); text-decoration: none; }
.footer-logo img { max-height: 32px; width: auto; }
.brand-desc { font-size: 0.9rem; color: var(--footer-text); line-height: 1.6; margin: 0; max-width: 320px; }

/* SOCIAL MENU (Dynamic) */
.social-nav-list {
    display: flex; gap: 10px; margin: 0; padding: 0; list-style: none;
    flex-wrap: wrap;
}
.social-nav-list li a {
    width: 40px; height: 40px; border-radius: 8px;
    background-color: var(--bg-body); 
    border: 1px solid var(--border);
    color: var(--footer-text); 
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 1.1rem;
}
.social-nav-list li a:hover {
    background-color: var(--primary); color: #fff; border-color: var(--primary);
    transform: translateY(-2px);
}
/* Walker text'ini gizle, sadece ikon */
.social-nav-list .menu-text { display: none; }
.social-nav-list i.menu-icon { margin: 0; }

/* Link Columns */
.link-col h4 {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--footer-title); margin-bottom: 20px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-links li a {
    text-decoration: none; color: var(--footer-text); font-size: 0.9rem;
    font-weight: 500; transition: color 0.2s;
}
.footer-links li a:hover { color: var(--primary); }

/* FOOTER BOTTOM (Copyright & Menu) */
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 32px;
    display: flex; 
    flex-direction: row; /* Yan yana */
    justify-content: space-between; /* İki uca yasla */
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright { font-size: 0.85rem; color: var(--footer-text); }

/* Footer Bottom Menu */
.bottom-nav-list {
    display: flex; gap: 24px; margin: 0; padding: 0; list-style: none;
}
.bottom-nav-list li a {
    font-size: 0.85rem; color: var(--footer-text); text-decoration: none;
    transition: 0.2s;
}
.bottom-nav-list li a:hover { color: var(--text-main); }

/* Responsive */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .brand-col { grid-column: span 2; }
}

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .brand-col { grid-column: span 1; text-align: center; align-items: center; }
    .brand-desc { text-align: center; }
    .social-nav-list { justify-content: center; }
    .link-col { text-align: center; }
    
    .footer-bottom { flex-direction: column-reverse; text-align: center; }
    .bottom-nav-list { flex-direction: column; gap: 12px; }
}

/* =========================================
   GLOBAL FORM ELEMENTS (Added from pages)
   ========================================= */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-main); margin-bottom: 6px; }

.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-sub); font-size: 0.875rem; }

.form-input, .form-select, .form-textarea {
    width: 100%; height: 44px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background-color: var(--input-bg); font-size: 0.95rem; color: var(--text-main);
    transition: all 0.2s; outline: none; font-family: 'Inter', sans-serif;
}
/* Input icon varsa padding */
.input-wrapper .form-input { padding-left: 36px; }

.form-textarea { height: auto; padding: 12px; resize: vertical; }

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary); background-color: var(--bg-surface); 
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); /* Indigo shadow based on primary */
}

/* =========================================
   GLOBAL BUTTONS
   ========================================= */
.btn {
    padding: 10px 24px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    text-decoration: none; border: none;
}

.btn-primary {
    width: 100%; height: 44px;
    background-color: var(--primary); color: white; border: none;
    border-radius: var(--radius); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
    display: flex; justify-content: center; align-items: center;
}
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-outline {
    background-color: var(--bg-surface); border: 1px solid var(--border); color: var(--text-main);
}
.btn-outline:hover { background-color: var(--hover-bg); border-color: var(--text-sub); }

.btn--ghost { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-main); }
.btn--ghost:hover { background: var(--hover-bg); border-color: var(--text-sub); }

/* =========================================
   AUTH PAGES (Login, Register, Lost Pass)
   ========================================= */
.login-card, .register-card {
    background: var(--bg-surface);
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Login Specific */
.login-card { max-width: 400px; padding: 40px; text-align: center; }

/* Register Specific */
.register-card { max-width: 900px; }
.card-header {
    padding: 24px; border-bottom: 1px solid var(--border);
    background-color: var(--hover-bg); display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 32px; }

/* Logo Area in Auth */
.logo-area {
    width: 56px; height: 56px;
    background-color: rgba(79, 70, 229, 0.1); color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 20px auto;
}

/* Auth Titles */
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.subtitle { color: var(--text-sub); font-size: 0.875rem; margin-bottom: 32px; }

.header-title h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.header-title p { color: var(--text-sub); font-size: 0.875rem; margin-top: 4px; }

/* Auth Helpers */
.form-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; font-size: 0.85rem;
}
.remember-me { display: flex; align-items: center; gap: 6px; color: var(--text-sub); cursor: pointer; }
.forgot-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

.divider {
    display: flex; align-items: center; text-align: center;
    margin: 24px 0; color: var(--text-sub); font-size: 0.75rem; font-weight: 500;
}
.divider::before, .divider::after {
    content: ''; flex: 1; border-bottom: 1px solid var(--border);
}
.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }

.register-text { margin-top: 24px; font-size: 0.875rem; color: var(--text-sub); }
.register-text a { color: var(--primary); font-weight: 600; text-decoration: none; }
.register-text a:hover { text-decoration: underline; }

.back-link, .back-to-login a {
    color: var(--text-sub); text-decoration: none; font-size: 0.875rem; font-weight: 500;
    display: flex; align-items: center; gap: 6px; transition: color 0.2s;
}
.back-link:hover, .back-to-login a:hover { color: var(--text-main); }
.back-to-login { margin-top: 24px; text-align: center; }

/* Messages */
.login-message, .register-message, .msg-box {
    margin-bottom: 20px; padding: 10px; border-radius: var(--radius); font-size: 0.9rem; display: none;
}
.login-message.error, .register-message.error, .msg-box.error { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.login-message.success, .register-message.success, .msg-box.success { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.loading-spinner {
    border: 2px solid rgba(255,255,255,0.3); border-top: 2px solid #fff; border-radius: 50%;
    width: 16px; height: 16px; animation: spin 1s linear infinite; margin-left: 8px; display: none;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   PROFILE PAGES
   ========================================= */
.profile-container {
    max-width: 1000px; margin: 40px auto; padding: 0 24px;
    display: flex; flex-direction: column; gap: 24px;
}
.profile-container.edit-mode { max-width: 900px; }

/* Profile Header Card */
.profile-header-card {
    background: var(--bg-surface); border-radius: var(--radius-md, 12px); border: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column;
    align-items: center; text-align: center; position: relative; overflow: hidden;
}
.profile-bg {
    position: absolute; top: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, #818CF8 100%); z-index: 0;
}
.avatar-lg {
    width: 100px; height: 100px; border-radius: 50%; border: 4px solid var(--bg-surface);
    object-fit: cover; position: relative; z-index: 1; margin-top: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); background: var(--bg-surface);
}
.user-identity { position: relative; z-index: 1; margin-top: 16px; }

/* FIX: Scoped to .profile-header-card to prevent conflict with header profile */
.profile-header-card .user-name { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }

.user-title { font-size: 0.9rem; color: var(--text-sub); font-weight: 500; }
.user-company { 
    display: inline-flex; align-items: center; gap: 6px; 
    margin-top: 8px; font-size: 0.85rem; color: var(--primary); 
    background: rgba(79, 70, 229, 0.1); padding: 4px 12px; border-radius: 20px; font-weight: 600;
}
.header-actions { position: absolute; top: 120px; right: 24px; z-index: 2; }

/* Profile Grid & Info Cards */
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.info-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px); padding: 24px; box-shadow: var(--shadow);
}
.card-title {
    font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 20px; 
    display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.card-title i { color: var(--primary); }
.info-list { display: flex; flex-direction: column; gap: 16px; }
.info-item { display: flex; flex-direction: column; gap: 4px; }
.label { font-size: 0.75rem; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.03em; }
.value { font-size: 0.95rem; color: var(--text-main); font-weight: 500; }
.social-link { color: #0077b5; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* Profile Edit Specifics */
.edit-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow); padding: 32px;
}
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.page-title p { color: var(--text-sub); font-size: 0.9rem; margin-top: 4px; }

.photo-upload {
    display: flex; align-items: center; gap: 24px; padding-bottom: 32px;
    border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.current-photo {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--bg-surface); box-shadow: 0 0 0 2px var(--border);
}
.upload-controls { display: flex; flex-direction: column; gap: 8px; }
.btn-upload {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-surface); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    color: var(--text-main); cursor: pointer; transition: 0.2s;
}
.btn-upload:hover { background: var(--hover-bg); border-color: var(--text-sub); }
.upload-hint { font-size: 0.75rem; color: var(--text-sub); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.full-width { grid-column: 1 / -1; }
.section-title {
    grid-column: 1 / -1; font-size: 0.9rem; font-weight: 700; color: var(--primary);
    border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-top: 8px;
}
.form-actions {
    margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 12px;
}

/* Searchable Select */
.search-container { position: relative; }
.search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 8px; margin-top: 4px; max-height: 200px; overflow-y: auto; z-index: 50; display: none;
    box-shadow: var(--shadow-lg);
}
.search-results.show { display: block; }
.search-item { padding: 10px 12px; font-size: 0.9rem; cursor: pointer; transition: 0.1s; color: var(--text-main); }
.search-item:hover { background: var(--hover-bg); }

/* Photo Upload in Register */
.photo-upload-section {
    display: flex; flex-direction: column; align-items: center; margin-bottom: 32px;
}
.photo-wrapper {
    width: 100px; height: 100px; border-radius: 50%;
    background-color: rgba(79, 70, 229, 0.05); border: 2px dashed var(--primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; position: relative;
    transition: all 0.2s;
}
.photo-wrapper:hover { background-color: rgba(79, 70, 229, 0.1); }
.photo-wrapper i { font-size: 1.5rem; color: var(--primary); }
.preview-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.upload-label { font-size: 0.875rem; color: var(--primary); font-weight: 600; margin-top: 8px; cursor: pointer; }
.upload-sub { font-size: 0.75rem; color: var(--text-sub); margin-top: 2px; }

/* Responsive adjustments */
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .header-actions { position: static; margin-top: 24px; } .content-grid { grid-template-columns: 1fr; } }