/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&display=swap');

:root {
    --bg-color: #f8f9fa;
    --zinc-50: #f8f9fa;
    --zinc-100: #f1f3f5;
    --zinc-200: #e9ecef;
    --zinc-300: #dee2e6;
    --zinc-400: #ced4da;
    --zinc-500: #adb5bd;
    --zinc-600: #6c757d;
    --zinc-700: #495057;
    --zinc-800: #343a40;
    --zinc-900: #212529;
    --accent: #f97316;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--zinc-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    padding: 3rem 0;
    border-bottom: 2px solid var(--zinc-900);
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 0;
    }
    .logo h1 {
        font-size: 2.25rem;
    }
    nav {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }
    nav a {
        flex: 1;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.65rem;
    }
}

.logo h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    line-height: 0.9;
}

.logo p {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--zinc-400);
    margin-top: 0.5rem;
}

nav a {
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

nav a.active {
    background-color: var(--zinc-900);
    color: white;
}

nav a:not(.active):hover {
    border-color: var(--zinc-300);
    color: var(--zinc-600);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 4rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--zinc-400);
    border-bottom: 1px solid var(--zinc-200);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid var(--zinc-200);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--zinc-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

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

/* Weekly Chart */
.chart-container {
    background: white;
    padding: 2rem;
    border: 1px solid var(--zinc-200);
    margin-bottom: 3rem;
}

.bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 0.75rem;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.bar-bg {
    width: 100%;
    background: var(--zinc-100);
    height: 100%;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background: var(--zinc-900);
    transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill:hover {
    background: var(--zinc-600);
}

.bar-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--zinc-400);
}

/* Calendar */
.calendar-card {
    background: white;
    padding: 2rem;
    border: 1px solid var(--zinc-200);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-label {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--zinc-400);
    margin-bottom: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 1px solid var(--zinc-100);
    position: relative;
}

.day-active {
    background: var(--zinc-50);
    border-color: var(--zinc-900);
    font-weight: 700;
}

.day-dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
}

/* Feed */
.feed {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.post {
    background: white;
    border: 1px solid var(--zinc-200);
}

.post-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    background: var(--zinc-100);
    border-bottom: 1px solid var(--zinc-200);
}

@media (min-width: 768px) {
    .post-image {
        height: 500px;
    }
}

.post-content {
    padding: 2rem;
}

@media (min-width: 768px) {
    .post-content {
        padding: 3rem;
    }
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--zinc-100);
    padding-bottom: 1rem;
}

.post-date {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.post-time {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--zinc-900);
}

.post-desc {
    font-size: 1.25rem;
    color: var(--zinc-800);
    line-height: 1.8;
}

/* Admin / Forms */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 800px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .admin-card {
        padding: 2.5rem;
    }
}

.admin-card.dark {
    background: var(--zinc-900);
    color: white;
}

.admin-card.light {
    background: white;
    border: 1px solid var(--zinc-200);
}

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

label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: var(--zinc-500);
}

.dark label {
    color: var(--zinc-400);
}

input, textarea, select {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--zinc-300);
    background: transparent;
    font-family: inherit;
    font-size: 16px; /* Prevents iOS zoom */
    outline: none;
    transition: border-color 0.2s ease;
}

.dark input {
    color: white;
    border-color: var(--zinc-700);
    background: #000;
}

input:focus {
    border-color: var(--zinc-900);
}

.dark input:focus {
    border-color: white;
}

button.btn {
    width: 100%;
    padding: 1rem;
    background: var(--zinc-900);
    color: white;
    border: none;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-white {
    background: white;
    color: var(--zinc-900);
}

button:hover {
    background: var(--zinc-700);
}

.btn-white:hover {
    background: var(--zinc-200);
}

code-block {
    display: block;
    background: black;
    color: #888;
    padding: 1.5rem;
    font-family: monospace;
    font-size: 0.75rem;
    line-height: 2;
    border: 1px solid var(--zinc-800);
    margin-top: 2rem;
    border-radius: 4px;
}

/* --- ADMIN HISTORY SECTION --- */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.history-card {
    background: white;
    border: 1px solid var(--zinc-300);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.history-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.history-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid var(--zinc-200);
}

.post-image-wrapper {
    width: 100%;
    background: var(--zinc-50);
    border-bottom: 1px solid var(--zinc-200);
    cursor: zoom-in;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-image-wrapper:hover .post-image {
    transform: scale(1.02);
}

.history-thumb-placeholder {
    width: 100%;
    height: 120px;
    background: var(--zinc-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--zinc-400);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.history-info {
    padding: 1rem;
}

.history-info div {
    margin-bottom: 0.25rem;
}

.btn-sm {
    width: 100%;
    padding: 0.4rem 0.8rem;
    background: var(--zinc-900);
    color: white;
    border: none;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-sm:hover {
    background: var(--accent);
}

/* --- LIGHTBOX --- */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
    border-radius: 4px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-out;
}

#lightbox.active img {
    transform: scale(1);
}

.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: white;
    font-size: 4rem;
    cursor: pointer;
    font-weight: 100;
    line-height: 1;
    z-index: 10000;
    transition: transform 0.2s ease;
}

.close-lightbox:hover {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .close-lightbox {
        top: 1rem;
        right: 1.5rem;
    }
}
