@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Israel Flag Colors */
    --israel-blue: #0038b8;
    --israel-blue-light: #4169e1;
    --israel-blue-dark: #002d96;
    --israel-blue-lighter: #e6f0ff;
    --israel-white: #ffffff;
    --israel-silver: #f8f9fa;
    --israel-accent: #1e40af;
    
    /* Supporting Colors */
    --secondary-blue: #3b82f6;
    --light-blue: #93c5fd;
    --very-light-blue: #dbeafe;
    --warning: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    
    /* Main Theme Colors */
    --primary: var(--israel-blue);
    --primary-dark: var(--israel-blue-dark);
    --primary-light: var(--israel-blue-lighter);
    --secondary: var(--secondary-blue);
    --accent: var(--israel-accent);
    --background: var(--israel-white);
    --surface: var(--israel-silver);
    --surface-dark: #f1f5f9;
    --text-primary: var(--israel-blue-dark);
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    
    /* Israel-themed Gradients */
    --gradient-primary: linear-gradient(135deg, var(--israel-blue) 0%, var(--israel-blue-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-blue) 0%, var(--light-blue) 100%);
    --gradient-accent: linear-gradient(135deg, var(--israel-blue-dark) 0%, var(--israel-blue) 100%);
    --gradient-light: linear-gradient(135deg, var(--very-light-blue) 0%, var(--israel-white) 100%);
    --gradient-patriotic: linear-gradient(135deg, var(--israel-blue) 0%, var(--secondary-blue) 100%);
    --gradient-hero: linear-gradient(135deg, var(--israel-blue-dark) 0%, var(--israel-blue-light) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-blue: 0 4px 15px rgba(0, 56, 184, 0.2);
    --shadow-primary: 0 4px 15px rgba(0, 56, 184, 0.3);
    
    /* Border Radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background: var(--gradient-hero);
    border-bottom: 2px solid var(--israel-blue-light);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
}

header:hover {
    box-shadow: var(--shadow-lg);
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--israel-white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header h1::before {
    content: "🇮🇱";
    font-size: 1.5rem;
}

.site-tagline {
    margin: 0.5rem 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
    border: 2px solid var(--israel-blue-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--gradient-accent);
    border-color: var(--israel-white);
}

.btn-secondary {
    background: var(--israel-white);
    color: var(--israel-blue-dark);
    border: 2px solid var(--israel-blue-light);
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--very-light-blue);
    border-color: var(--israel-blue);
    transform: translateY(-1px);
    color: var(--israel-blue);
}
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filters Section */
.filters-section {
    background: var(--surface);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filters-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.filters-container {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-group select:hover {
    border-color: var(--primary);
}

.filter-results {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Picture Grid */
.picture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.picture-item {
    background: var(--background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.picture-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.picture-item.highlighted {
    animation: highlightPulse 3s ease-in-out;
    border: 2px solid var(--primary);
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 56, 184, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(0, 56, 184, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 56, 184, 0); }
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 56, 184, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(0, 56, 184, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 56, 184, 0); }
}

.picture-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.picture-item:hover img {
    transform: scale(1.05);
}

.picture-info {
    padding: 1.5rem;
}

.celebrity-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.picture-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.picture-details div {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picture-details strong {
    color: var(--text-primary);
    font-weight: 600;
    min-width: fit-content;
}

.picture-details a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.picture-details a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    gap: 1rem;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex: 1;
}

.copy-link-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.copy-link-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.copy-icon {
    font-size: 0.8rem;
}

.copy-text {
    font-weight: 500;
}

/* Statistics Section */
.statistics {
    background: var(--background);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.statistics h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transition: height 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.stat-card.primary {
    --gradient: var(--gradient-primary);
    border-color: rgba(0, 56, 184, 0.2);
    box-shadow: var(--shadow-primary);
}

.stat-card.political {
    --gradient: var(--gradient-secondary);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: var(--shadow-blue);
}

.stat-card.business {
    --gradient: var(--gradient-accent);
    border-color: rgba(30, 64, 175, 0.2);
    box-shadow: var(--shadow-primary);
}

.stat-card.wealth {
    --gradient: var(--gradient-light);
    border-color: rgba(0, 56, 184, 0.2);
    box-shadow: var(--shadow-blue);
}

.stat-card.global {
    --gradient: var(--gradient-primary);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: var(--shadow-primary);
}

.stat-card.recent {
    --gradient: var(--gradient-secondary);
    border-color: rgba(30, 64, 175, 0.2);
    box-shadow: var(--shadow-blue);
}

.stat-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.stat-content {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stats-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.detailed-stat {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.detailed-stat h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.chart-mini {
    height: 120px;
    position: relative;
}

.d3-chart {
    width: 100%;
    height: 300px;
    position: relative;
}

/* D3 Tooltip Styles */
.d3-tooltip {
    font-family: 'Inter', sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

/* Interactive Chart Elements */
.bar:hover, .arc:hover, .dot:hover, .country-bubble:hover {
    filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* Chart Animations */
.chart-enter {
    animation: chartSlideIn 0.8s ease-out;
}

@keyframes chartSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Charts Section */
.charts-section {
    background: var(--background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-top: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.charts-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.chart-container h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--background);
    margin: 2rem auto;
    padding: 0;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    border: none;
    background: none;
    padding: 0.25rem;
    border-radius: var(--radius);
}

.close:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

form label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.875rem;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--background);
    color: var(--text-primary);
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

form small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: -1rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Pending Items */
.pending-item {
    margin-bottom: 2rem;
}

.pending-card {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.pending-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.pending-image {
    position: relative;
    background: var(--surface-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.pending-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
}

.pending-details {
    padding: 1.5rem;
}

.pending-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.pending-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.title-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-primary);
}

.pending-info {
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.billionaire-yes {
    color: var(--success);
    font-weight: 700;
}

.billionaire-no {
    color: var(--text-muted);
}

.references-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.references-list {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reference-link {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--primary);
}

.reference-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.trivia-section {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.trivia-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trivia-section h5::before {
    content: "💡";
    font-size: 1.1rem;
}

.trivia-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.trivia-list li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    padding-left: 1rem;
}

.trivia-list li:last-child {
    border-bottom: none;
}

.trivia-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.pending-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.approve-btn,
.reject-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.approve-btn {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.approve-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reject-btn {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.reject-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 1rem;
    font-weight: bold;
}

.no-pending {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

/* Admin Modal Specific Styles */
#adminModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
}

#adminModal .modal-body {
    padding: 1.5rem;
}

#pendingPictures h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    background: var(--surface-dark);
    border-top: 1px solid var(--border-light);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-admin {
    position: relative;
}

.admin-link {
    color: var(--border);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    display: inline-block;
    line-height: 1;
}

.admin-link:hover {
    color: var(--text-muted);
    background: var(--border-light);
    transform: scale(1.1);
}

.admin-link:active {
    transform: scale(0.95);
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .footer-content {
        justify-content: center;
        text-align: center;
    }
    
    .footer-admin {
        position: absolute;
        bottom: 0.5rem;
        right: 1rem;
    }
}

/* Visit Modal Styles */
.visit-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    width: 95%;
    margin: 2rem auto;
}

.visit-modal-content {
    background: var(--background);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.visit-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.visit-image {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--surface-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 300px;
    max-height: 500px;
}

.visit-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius);
}

.visit-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.visit-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}

.visit-actions .btn {
    min-width: 160px;
}

.trivia-section h4,
.references-section h4 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trivia-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.trivia-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-secondary);
}

.trivia-list li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.references-section {
    margin-top: 1rem;
}

.references-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.references-list .reference-link {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--primary);
}

.references-list .reference-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Responsive design for visit modal */
@media (max-width: 768px) {
    .visit-modal .modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 95vh;
    }
    
    .visit-details {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .visit-image {
        min-height: 200px;
        max-height: 300px;
    }
    
    .visit-actions {
        flex-direction: column;
        padding: 1rem;
    }
    
    .visit-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .info-value {
        text-align: left;
        margin-left: 0;
    }
}

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .picture-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stats-detailed {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .d3-chart {
        height: 250px;
    }
    
    .chart-mini {
        height: 100px;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .pending-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .statistics {
        padding: 1.5rem;
    }
    
    .stats-detailed {
        margin-top: 1.5rem;
    }
}

/* Individual Card Page Styles */
.individual-card-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.card-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-light);
}

.card-navigation h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
}

.individual-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    border: 2px solid var(--primary-light);
}

.card-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.card-details h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.detail-item strong {
    color: var(--primary);
    min-width: 140px;
    font-weight: 600;
}

.trivia-section,
.references-section {
    margin-bottom: 2rem;
}

.trivia-section h3,
.references-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.trivia-list {
    list-style: none;
    padding: 0;
}

.trivia-list li {
    background: var(--very-light-blue);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.references-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.reference-link {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.reference-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .individual-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .card-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .card-navigation h1 {
        font-size: 1.5rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .individual-card-page {
        padding: 1rem;
    }
}

/* Gallery Reference Links Styling */
.references-section {
    margin: 0.75rem 0;
    padding: 0.5rem 0;
}

.reference-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.reference-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: var(--gradient-primary);
    color: white !important;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}

.reference-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--gradient-accent);
    border-color: var(--israel-blue-light);
    color: white !important;
}

.ref-icon {
    font-size: 0.9rem;
    color: white !important;
}

.ref-text {
    font-weight: 600;
    color: white !important;
}

@media (max-width: 768px) {
    .reference-links {
        flex-direction: column;
    }
    
    .reference-badge {
        justify-content: center;
        text-align: center;
    }
}