/* style.css */

/* General */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

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

.site-header {
    background: linear-gradient(90deg, #0f766e, #2563eb);
    color: #fff;
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.subtitle {
    margin: 0.15rem 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.site-footer {
    padding: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Public page */
.public-page main {
    padding: 1.5rem 0 2.5rem;
}

.project-card {
    background: #ffffff;
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.project-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.project-text {
    margin: 0.5rem 0 0.75rem;
    line-height: 1.6;
}

.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.media-item img,
.media-item video {
    display: block;
    max-width: 260px;
    max-height: 180px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #000;
}

.empty-message {
    margin-top: 2rem;
    text-align: center;
    color: #6b7280;
}

/* Admin login */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1d4ed8, #020617 60%);
    color: #e5e7eb;
}

.login-box {
    background: rgba(15, 23, 42, 0.95);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.8);
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.login-box label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    margin-bottom: 0.9rem;
}

.login-box button {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #22c55e, #06b6d4);
    color: #020617;
    font-weight: 600;
    cursor: pointer;
}

.login-box button:hover {
    opacity: 0.95;
}

.error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.back-link {
    margin-top: 0.75rem;
    text-align: center;
}

.back-link a {
    color: #93c5fd;
    text-decoration: none;
}

/* Admin panel */
.admin-panel {
    background: #020617;
    color: #e5e7eb;
}

.admin-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0 2.5rem;
}

.panel {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px;
    padding: 1rem 1.1rem 1.3rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
}

.left-panel {
    flex: 1 1 45%;
    min-width: 260px;
}

.right-panel {
    flex: 1 1 45%;
    min-width: 260px;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.projects-table th,
.projects-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #1f2937;
}

.projects-table th {
    text-align: left;
    color: #9ca3af;
    font-weight: 500;
}

.projects-table tr:hover td {
    background: rgba(31, 41, 55, 0.7);
}

/* Buttons */
.button,
.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.3);
    color: #e5e7eb;
}

.button.primary {
    background: linear-gradient(90deg, #22c55e, #06b6d4);
    color: #020617;
}

.button.secondary {
    background: rgba(148, 163, 184, 0.2);
}

.button.danger {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.button.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
}

.admin-link {
    background: rgba(15, 23, 42, 0.2);
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.alert.success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.alert.danger {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

/* Form */
.project-form label {
    display: block;
    margin-top: 0.7rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.project-form input[type="text"],
.project-form textarea,
.project-form input[type="file"] {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #374151;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.9rem;
}

.project-form textarea {
    resize: vertical;
    min-height: 130px;
}

.project-form button {
    margin-top: 1rem;
}

/* Existing media preview in admin */
.media-list-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.media-list-item {
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 0.3rem;
    width: 120px;
    text-align: center;
    background: #020617;
}

.media-list-item img,
.media-list-item video {
    max-width: 100%;
    max-height: 80px;
    border-radius: 6px;
}

.delete-checkbox {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
