/* ============================================================
   Reset & Box-Sizing
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   Variables / Base Colors
============================================================ */
:root {
  --bg-gradient-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: white;
  --radius: 10px;
  --shadow: 0 4px 15px rgba(0,0,0,0.1);
  --btn-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --muted: #666;
  --text: #333;
  --radius-lg: 15px;
}

/* ============================================================
   Global
============================================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height:1.4;
    color: var(--text);
    background: var(--bg-gradient-light);
    min-height: 100vh;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    background: var(--header-bg);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Upload section */
.upload-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.btn {
    background: var(--btn-gradient);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all .3s ease;
    display: inline-block;
    text-decoration:none;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Photo grid */
.photo-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.photo-card, .photo-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .3s ease, box-shadow .3s ease;
    cursor: pointer;
}
.photo-card:hover, .photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.photo-card img, .photo-item img {
    width: 100%;
    height: 600px;
    object-fit: cover;
}
.photo-info {
    padding: 1rem;
}
.photo-date {
    font-weight: bold;
    color: #667eea;
    margin-bottom: .5rem;
}
.photo-filename {
    font-size: .9rem;
    color: var(--muted);
}
.photo-camera {
    font-size: .8rem;
    color: #888;
}

/* night/light mode toggle */
.theme-toggle {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  padding: 0 20px;
}
.theme-toggle .active {
  box-shadow: 0 0 0 3px rgba(255,205,51,0.6);
  position: relative;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background-color: rgba(0,0,0,.9);
}
.modal-content {
    position: relative;
    background: white;
    margin:2% auto;
    padding:0;
    width:90%;
    max-width:1000px;
    border-radius:10px;
    overflow:hidden;
    max-height:90vh;
    overflow-y:auto;
}
.modal-header {
    background: var(--header-bg);
    color:white;
    padding:1rem 1.5rem;
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.close {
    color:white;
    font-size:28px;
    font-weight:bold;
    cursor:pointer;
}
.close:hover { opacity:.7; }
.modal-body {
    padding:1.5rem;
}
.modal-image {
    width:100%;
    max-height:60vh;
    object-fit: contain;
    border-radius:5px;
    margin-bottom:1rem;
}
.exif-info {
    background:#f8f9fa;
    padding:1rem;
    border-radius:5px;
    margin-top:1rem;
}
.exif-info h3 {
    margin-bottom:1rem;
    color:#333;
}
.exif-grid {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap:.5rem;
}
.exif-item {
    display:flex;
    justify-content: space-between;
    padding:.25rem 0;
    border-bottom:1px solid #e9ecef;
}
.exif-label { font-weight:bold; color:#495057; }
.exif-value { color:#6c757d; }

/* Upload modal */
.upload-modal .modal-content { max-width:600px; }
.file-preview { background:#f8f9fa; padding:1rem; margin:1rem 0; border-radius:5px; border-left:4px solid #667eea; }
.file-info { margin-bottom:.5rem; }
.loading { display:none; text-align:center; padding:2rem; }
.spinner { border:4px solid #f3f3f3; border-top:4px solid #667eea; border-radius:50%; width:40px; height:40px; animation:spin 1s linear infinite; margin:0 auto 1rem; }
@keyframes spin { 0% { transform:rotate(0deg); } 100% { transform:rotate(360deg); } }
.success-message, .error-message { padding:1rem; margin:1rem 0; border-radius:5px; display:none; }
.success-message { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.error-message { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }

/* No photos fallback */
.no-photos { text-align:center; color:#636e72; font-size:1.1em; padding:50px; background:#f8f9fa; border-radius:15px; margin:20px 0; }
.no-photos .sunflower { font-size:3em; margin-bottom:20px; }

/* Responsive */
@media (max-width: 768px) {
    .photo-grid { grid-template-columns:1fr; }
    .header h1 { font-size:2rem; }
    .modal-content { width:95%; margin:5% auto; }
}

/* Sun (bright) theme overrides */
.sun-theme {
  --bg-gradient-light: linear-gradient(135deg, #fff9f0 0%, #ffe29f 100%);
  --header-bg: linear-gradient(135deg, #ffcc33 0%, #ff9900 100%);
  --card-bg: #fffbee;
  --btn-gradient: linear-gradient(135deg, #ffb347 0%, #ffcc33 100%);
  --text: #2f2f2f;
}
.sun-theme .header {
  color: #3d2f1b;
}
.sun-theme .photo-date {
  color: #d97706;
}

/* D/* Lunar / dark theme */
.lunar-theme, .night-theme {
    --bg-gradient-light: #0f101a;
    --header-bg: linear-gradient(135deg, #0b0c2d 0%, #4b367c 100%);
    --card-bg: #1e1e2f;
    --btn-gradient: linear-gradient(135deg, #555779 0%, #6f63a6 100%);
    --muted: #aaa;
    --text: #e8e8f2;
}
.lunar-theme body, .night-theme body {
    background: var(--bg-gradient-light);
    color: var(--text);
}
.lunar-theme .container, .night-theme .container { background:#1e1e1e; box-shadow:0 10px 30px rgba(255,255,255,0.1); }
.lunar-theme .header, .night-theme .header { background: linear-gradient(135deg, #0b0c2d 0%, #4b367c 100%); color:#f5f5f5; }
.lunar-theme .header h1, .night-theme .header h1 { text-shadow:2px 2px 6px rgba(255,255,255,0.3); }
.lunar-theme .upload-section, .night-theme .upload-section { background:#2a2a3d; border-bottom:1px solid #444466; }
.lunar-theme .btn, .night-theme .btn { background: #555; }
.lunar-theme .photo-card, .lunar-theme .photo-item, .night-theme .photo-card, .night-theme .photo-item { background:#2a2a2a; border:1px solid #444; box-shadow:none; }
.lunar-theme .photo-info, .night-theme .photo-info { color:#ccc; }
.lunar-theme .photo-date, .night-theme .photo-date { color:#999; }
ark / Lunar */
.night-theme body {
    background:#121212;
    color:#f5f5f5;
}
.night-theme .container { background:#1e1e1e; box-shadow:0 10px 30px rgba(255,255,255,0.1); }
.night-theme .header { background: linear-gradient(135deg, #0b0c2d 0%, #4b367c 100%); color:#f5f5f5; }
.night-theme .header h1 { text-shadow:2px 2px 6px rgba(255,255,255,0.3); }
.night-theme .upload-section { background:#2a2a3d; border-bottom:1px solid #444466; }
.night-theme .btn { background: #555; }
.night-theme .photo-card, .night-theme .photo-item { background:#2a2a2a; border:1px solid #444; box-shadow:none; }
.night-theme .photo-info { color:#ccc; }
.night-theme .photo-date { color:#999; }
.theme-toggle .active {
  box-shadow: 0 0 0 3px rgba(255,205,51,0.6);
}