* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #004e89;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --border-color: #ddd;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --spacing: 1rem;
}

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Comfortaa', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        linear-gradient(180deg, rgba(11, 16, 51, 0.42) 0%, rgba(17, 16, 38, 0.58) 40%, rgba(16, 15, 29, 0.75) 100%),
        url('IMG_1246.jpg');
    background-size: cover, cover;
    background-position: center 20%, center;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.4rem 1rem 1.8rem;
    min-height: 100vh;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 10%, rgba(255, 138, 81, 0.06), transparent 28%);
    pointer-events: none;
}

.hero h1 {
    position: relative;
    font-size: clamp(2.2rem, 9vw, 3.2rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.hero .upload-card {
    position: relative;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 26px;
    padding: 1rem;
    width: min(440px, 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.hero .upload-icon {
    font-size: 2.3rem;
    margin-bottom: 0.7rem;
}

.hero h2 {
    color: #122a4d;
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
    line-height: 1.15;
}

.hero .description {
    color: #2f405d;
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
    line-height: 1.45;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
    display: flex;
    justify-content: center;
}

.upload-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s ease-out;
}

.upload-icon {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 0.65rem;
}

.upload-card h2 {
    text-align: center;
    color: #0a2f5e;
    margin-bottom: 0.35rem;
    font-size: 1.4rem;
}

.description {
    text-align: center;
    color: #2b3a55;
    margin-bottom: 1rem;
    font-size: 0.94rem;
    line-height: 1.45;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed rgba(255, 108, 52, 0.85);
    border-radius: 20px;
    padding: 0.95rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 126, 54, 0.06);
    transition: all 0.3s ease;
    margin-bottom: 0.9rem;
    border-color: rgba(255, 108, 52, 1);
    background: rgba(255, 176, 111, 0.12);
}

.upload-area.drag-over {
    border-color: #7ee7ff;
    background: rgba(126, 231, 255, 0.14);
    transform: translateY(-1px);
}

.upload-placeholder p {
    color: #192f5d;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.upload-placeholder small {
    color: #52698f;
    display: block;
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

/* ===== PREVIEW ===== */
.preview-container {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    background: var(--light-color);
}

.preview-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.btn-clear {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ===== BUTTONS ===== */
.btn-primary,
.btn-secondary,
.btn-admin {
    padding: 0.9rem 1.6rem;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7a3d, #ffd15f);
    color: #11101c;
    box-shadow: 0 8px 20px rgba(255, 122, 61, 0.22);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
    margin: 0.5rem 0;
}

.btn-secondary:hover {
    background: #003a63;
    transform: translateY(-2px);
}

.btn-admin {
    background: var(--accent-color);
    color: white;
    margin-top: 1rem;
}

.btn-admin:hover {
    background: #003a63;
    transform: translateY(-2px);
}

.btn-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #ffeb3b;
}

/* ===== MESSAGES ===== */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 500;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    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); }
}

/* ===== ADMIN SECTION ===== */
.admin-section {
    display: flex;
    justify-content: center;
}

.admin-card {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    animation: slideUp 0.6s ease-out;
}

.admin-card h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* ===== AUTH FORM ===== */
.auth-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* ===== ADMIN DASHBOARD ===== */
.admin-dashboard {
    animation: fadeIn 0.6s ease-out;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
}

/* ===== FILTER SECTION ===== */
.filter-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-section input {
    flex: 1;
    min-width: 200px;
}

.filter-section button {
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

/* ===== PHOTO GRID ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.photo-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-color);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.photo-item.selected {
    outline: 3px solid var(--primary-color);
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    max-height: 50px;
    overflow: hidden;
}

.photo-delete-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--error-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    opacity: 0;
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: #c0392b;
}

/* ===== DOWNLOAD SECTION ===== */
.download-section {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.stats {
    margin-bottom: 1rem;
    text-align: center;
}

.stats p {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.download-section button {
    margin-bottom: 0.5rem;
}

.download-section button:last-child {
    margin-bottom: 0;
}

/* ===== ADMIN LINK ===== */
.admin-link {
    text-align: center;
    margin-top: 2rem;
}

.admin-link .btn-admin {
    max-width: 300px;
    margin: 0 auto;
}

/* ===== BACK LINK ===== */
.back-link {
    text-align: center;
    margin-top: 2rem;
}

/* ===== PROMO TEXT ===== */
.promo-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1rem;
}

.promo-text p {
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.4;
    font-weight: 500;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.promo-text .small-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: none;
    margin-top: 0.5rem;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%),
            url('IMG_12462.jpg');
        background-size: cover;
        background-position: 50% 25%;
        background-repeat: no-repeat;
    }

    .container {
        padding: 0.55rem 0.7rem 0.8rem;
    }

    .container main {
        display: flex;
        flex-direction: column;
        min-height: 100svh;
    }

    .hero {
        padding: 1rem 0.15rem 0.5rem;
        min-height: auto;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .hero h1 {
        max-width: 11em;
        font-size: clamp(2rem, 9vw, 2.75rem);
        letter-spacing: -0.02em;
        line-height: 0.98;
        text-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    }

    .hero::before {
        background: none;
    }

    .hero .upload-card {
        width: 84%;
        max-width: 310px;
        padding: 1.4rem 1rem 1.4rem;
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    }

    .hero .upload-icon {
        font-size: 2.1rem;
        margin-bottom: 0.5rem;
    }

    .hero h2 {
        color: #0b4e85;
        font-size: 1.35rem;
        font-weight: 700;
        margin-bottom: 0.35rem;
    }

    .hero .description {
        color: #556075;
        font-size: 0.78rem;
        margin-bottom: 0.9rem;
        line-height: 1.35;
        gap: 0.5rem;
    }

    .promo-text p {
        font-size: clamp(1.35rem, 6vw, 1.85rem);
        line-height: 1.08;
        font-weight: 400;
        color: #2ed6ff;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .upload-area {
        padding: 1.1rem 0.6rem;
        border: 2px dashed #ff4e00;
        border-radius: 12px;
        background: #ffffff;
    }

    .upload-placeholder p {
        color: #0c4d87;
        font-size: clamp(0.72rem, 3.2vw, 0.85rem);
        font-weight: 700;
        line-height: 1.25;
    }

    .upload-placeholder small {
        color: #8c909e;
        font-size: 0.72rem;
        margin-top: 0.4rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-admin {
        width: 100%;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .photo-item img {
        height: 100px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header button {
        width: 100%;
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-section input,
    .filter-section button {
        width: 100%;
    }

    .promo-text {
        margin-top: auto;
        max-width: 23rem;
        padding: 0 0.35rem 0.35rem;
        gap: 0.35rem;
    }

    .promo-text .small-note {
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.92);
        line-height: 1.15;
    }

    .admin-link,
    footer {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 0.85rem 0.1rem 0.45rem;
    }

    .hero h1 {
        font-size: 2.15rem;
    }

    .upload-card,
    .admin-card {
        padding: 0.95rem;
        max-width: 360px;
    }

    .upload-area {
        padding: 0.85rem;
    }

    .upload-placeholder p {
        font-size: 0.96rem;
    }

    .upload-placeholder small {
        font-size: 0.82rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-admin {
        font-size: 0.98rem;
        padding: 0.85rem 1.2rem;
    }

    .promo-text p {
        font-size: 1.45rem;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }

    .photo-item img {
        height: 80px;
    }

    .message {
        font-size: 0.9rem;
    }
}
