/* ===== General Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
}

/* ===== Navbar Styles ===== */
.navbar {
    background-color: #2777b9;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    font-family: Georgia, serif;
}

.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-link.active {
    background-color: rgba(255,255,255,0.15);
}

.nav-link i {
    font-size: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.profile-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: none;
    transition: background-color 0.2s;
}

.profile-btn:hover {
    opacity: 0.8;
}

.add-btn {
    background-color: hsl(0, 0%, 89%);
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background-color: #d0d0d0;
}

/* ===== Admin Container ===== */
.admin-container {
    margin-top: 80px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 20px;
}

.admin-header {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.admin-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header p {
    color: #666;
    font-size: 14px;
}

/* ===== Action Bar ===== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.action-bar strong {
    color: #333;
    font-size: 16px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #2777b9;
    color: white;
}

.btn-primary:hover {
    background-color: #1e5f8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 119, 185, 0.3);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ===== Lomba Grid ===== */
.lomba-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.empty-state {
    grid-column: 1 / -1;
    background: white;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

.lomba-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid #2777b9;
}

.lomba-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.lomba-card-header {
    background: linear-gradient(135deg, #2777b9 0%, #1e5f8c 100%);
    padding: 15px;
    color: white;
}

.lomba-card-header h3 {
    font-size: 16px;
    margin-bottom: 5px;
    word-break: break-word;
}

.lomba-card-kategori {
    display: inline-block;
    background: rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 8px;
}

.lomba-card-body {
    padding: 15px;
}

.lomba-info {
    margin-bottom: 12px;
    font-size: 13px;
}

.lomba-info-label {
    color: #666;
    font-weight: 500;
    margin-bottom: 3px;
}

.lomba-info-value {
    color: #333;
    line-height: 1.4;
}

.lomba-card-footer {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}

.btn-small {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #2777b9 0%, #1e5f8c 100%);
    color: white;
}

.modal-header h2 {
    font-size: 20px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: rgba(0,0,0,0.1);
}

.modal-body {
    padding: 25px;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2777b9;
    box-shadow: 0 0 0 3px rgba(39, 119, 185, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 15px;
    }

    .search-box {
        display: none;
    }

    .lomba-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .admin-header {
        padding: 20px;
    }

    .admin-header h1 {
        font-size: 22px;
    }

    .modal-content {
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .nav-left {
        gap: 15px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-link span {
        display: none;
    }

    .nav-menu {
        gap: 10px;
    }
}

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #2777b9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}
