/* EczaDolabım - Modern UI Styles */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #10b981;
    --primary-light: #d1fae5;
    --primary-dark: #059669;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    
    --secondary: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --orange: #f59e0b;
    --red: #ef4444;
    
    --bg: #f8faf9;
    --bg-card: #ffffff;
    --bg-input: #f3f4f6;
    
    --text: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --nav-height: 80px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* ============================================
   Splash Screen
   ============================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    padding: 2rem;
    max-width: 360px;
}

.splash-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.logo-icon {
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.logo-icon svg {
    width: 56px;
    height: 56px;
    color: white;
}

.logo-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.logo-badge svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.splash-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.splash-title span {
    color: var(--primary);
}

.splash-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.splash-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 1.25rem;
}

.splash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: var(--text);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.splash-btn svg {
    width: 20px;
    height: 20px;
}

.splash-btn:active {
    transform: scale(0.98);
}

.splash-version {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Auth Screen
   ============================================ */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--bg);
}

.auth-container {
    width: 100%;
    max-width: 380px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-header h1 span {
    color: var(--primary);
}

.auth-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.auth-form h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: white;
}

.input-icon {
    padding-left: 1rem;
    font-size: 1rem;
}

.input-wrapper input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    color: var(--text);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    outline: none;
}

.form-group input:not(.input-wrapper input),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-block {
    width: 100%;
}

.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-toggle a {
    font-weight: 600;
    margin-left: 0.25rem;
}

/* ============================================
   Main App
   ============================================ */
.main-app {
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
}

/* Desktop wrapper */
@media (min-width: 481px) {
    body {
        background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e9 100%);
    }
    
    .main-app {
        min-height: 100vh;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    
    .modal-content {
        max-width: 420px;
    }
    
    .splash-screen,
    .auth-screen {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }
}

.page {
    display: none;
    padding: 1rem 1.25rem;
    padding-bottom: 2rem;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 1.5rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.greeting {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg-input);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.btn-add-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-add-member svg {
    width: 18px;
    height: 18px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================
   Family List (Home Page)
   ============================================ */
.family-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.family-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
}

.family-card:active {
    transform: scale(0.99);
}

.family-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.family-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.family-info {
    flex: 1;
    min-width: 0;
}

.family-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.family-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.status-dot.warning {
    background: var(--orange);
}

.status-dot.danger {
    background: var(--red);
}

.family-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.tag.orange {
    background: #fff7ed;
    color: #ea580c;
}

.tag.blue {
    background: #eff6ff;
    color: #2563eb;
}

.tag.purple {
    background: #faf5ff;
    color: #9333ea;
}

.tag.red {
    background: #fef2f2;
    color: #dc2626;
}

.tag.green {
    background: #ecfdf5;
    color: #059669;
}

.family-arrow {
    color: var(--text-muted);
}

.family-arrow svg {
    width: 20px;
    height: 20px;
}

/* Quick Add Card */
.quick-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    margin-top: 1rem;
    background: var(--bg-card);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-add-card:hover {
    background: var(--primary-light);
}

.quick-add-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add-icon svg {
    width: 24px;
    height: 24px;
}

.quick-add-card span {
    font-weight: 600;
}

/* ============================================
   Calendar Page
   ============================================ */
.calendar-week {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.calendar-day {
    flex: 1;
    min-width: 48px;
    padding: 0.75rem 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    border-color: var(--border);
}

.calendar-day.active {
    background: var(--primary);
    color: white;
}

.calendar-day .day-name {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.7;
}

.calendar-day .day-number {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.schedule-item.done {
    opacity: 0.6;
}

.schedule-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 50px;
}

.schedule-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-info {
    flex: 1;
}

.schedule-name {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.schedule-member {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.schedule-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
}

.schedule-check.checked {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.schedule-check svg {
    width: 16px;
    height: 16px;
}

.schedule-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.schedule-empty a {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* ============================================
   Medicines Page
   ============================================ */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    margin-top: 1rem;
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.medicines-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.medicine-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.medicine-card:active {
    transform: scale(0.99);
}

.medicine-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.medicine-info {
    flex: 1;
    min-width: 0;
}

.medicine-name {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.medicine-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.medicine-expiry {
    text-align: right;
}

.medicine-expiry .date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.medicine-expiry .status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.medicine-expiry .status.safe {
    color: var(--primary);
}

.medicine-expiry .status.warning {
    color: var(--orange);
}

.medicine-expiry .status.danger {
    color: var(--red);
}

/* ============================================
   Reports Page
   ============================================ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.green { background: #ecfdf5; }
.stat-icon.blue { background: #eff6ff; }
.stat-icon.orange { background: #fff7ed; }
.stat-icon.red { background: #fef2f2; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.report-section {
    margin-bottom: 1.5rem;
}

.report-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.category-stats,
.member-stats {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.category-item,
.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.category-item:last-child,
.member-item:last-child {
    border-bottom: none;
}

.category-icon {
    font-size: 1.25rem;
}

.category-name,
.member-name {
    flex: 1;
    font-weight: 500;
}

.category-count,
.member-count {
    font-weight: 600;
    color: var(--primary);
}

.member-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
    margin: -1rem -1.25rem 1.5rem;
    padding-top: 3rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#profilePage h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-role {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.profile-menu {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background: var(--bg-input);
}

.menu-icon {
    font-size: 1.25rem;
}

.profile-menu-item span:nth-child(2) {
    flex: 1;
    font-weight: 500;
}

.profile-menu-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    color: var(--red);
    font-weight: 600;
    text-align: center;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

@media (max-width: 480px) {
    .bottom-nav {
        left: 0;
        transform: none;
        max-width: 100%;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--primary);
}

.fab-nav {
    position: relative;
}

.fab-btn {
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -24px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.fab-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

.fab-nav span {
    margin-top: 0.25rem;
}

/* ============================================
   Modals
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 1.25rem;
}

/* Photo Section */
.photo-section {
    margin-bottom: 1.5rem;
}

.photo-preview {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.photo-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.photo-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.photo-placeholder span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.photo-placeholder small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview.analyzing {
    position: relative;
}

.photo-preview.analyzing::after {
    content: '🔍 Analiz ediliyor...';
    position: absolute;
    inset: 0;
    background: rgba(16, 185, 129, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.photo-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.photo-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--text);
    color: white;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.photo-btn.outline {
    background: var(--bg-card);
    color: var(--text);
    border: 2px solid var(--border);
}

.photo-btn svg {
    width: 20px;
    height: 20px;
}

/* Avatar Selector */
.avatar-selector {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.color-options {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option.active {
    border-color: var(--text);
    transform: scale(1.1);
}

/* Settings */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Camera Modal */
.camera-container {
    position: fixed;
    inset: 0;
    background: black;
    display: flex;
    flex-direction: column;
}

.camera-container video {
    flex: 1;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
}

.camera-btn-close,
.camera-btn-switch {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.camera-btn-close svg,
.camera-btn-switch svg {
    width: 24px;
    height: 24px;
}

.camera-btn-capture {
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capture-ring {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary);
    border-radius: 50%;
}

/* ============================================
   Detail Modal Content
   ============================================ */
.detail-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.detail-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.detail-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-section p {
    color: var(--text);
    line-height: 1.6;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.detail-actions button {
    flex: 1;
    padding: 0.875rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-archive {
    background: var(--bg-input);
    color: var(--text);
}

.btn-delete {
    background: #fef2f2;
    color: var(--red);
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
    max-width: calc(100% - 2rem);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: var(--red);
}

/* ============================================
   Loading
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 640px) {
    .modal-content {
        border-radius: var(--radius-xl);
        margin: auto;
        max-height: 85vh;
    }
    
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}
