/* Admin Base Styles */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #10b981;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f0fdf4;
    --bg-dark: #0f172a;
    --text-color: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --border-color: #d1fae5;
    --shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
}

.login-info {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

/* Admin Navigation */
.admin-nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.admin-nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-nav-brand h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.admin-nav-visits {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: 10px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}
.admin-nav-visits i {
    opacity: 0.9;
}

.admin-burger {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.admin-nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-nav-user span {
    font-weight: 600;
    color: var(--text-color);
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: var(--white);
    padding: 2rem 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-color);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: var(--bg-color);
    border-left-color: var(--primary-light);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.menu-item i {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 0 2rem;
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 2rem;
    color: var(--text-color);
}

/* Items List */
.items-list {
    display: grid;
    gap: 1.5rem;
}

.item-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.item-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.item-meta {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.item-content {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.item-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.badge-news { background: #dbeafe; color: #1e40af; }
.badge-events { background: #fce7f3; color: #be185d; }
.badge-sports { background: #dcfce7; color: #166534; }
.badge-culture { background: #fef3c7; color: #92400e; }
.badge-other { background: #f3e8ff; color: #6b21a8; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-color);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Settings */
.settings-content {
    display: grid;
    gap: 2rem;
}

.settings-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.settings-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.settings-card .btn {
    margin-right: 1rem;
    margin-top: 0.5rem;
}

.visit-counter-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.75rem 0 1rem;
}
.visit-counter-text {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal-close {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content form {
    padding: 2rem;
    overflow-y: auto;
}

/* Messages */
.error-message,
.success-message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-nav {
        padding: 1rem;
    }

    .admin-nav-brand h2 {
        font-size: 1.2rem;
    }

    .admin-burger {
        display: flex;
    }

    .admin-nav-visits {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .admin-nav-user span {
        display: none;
    }

    .admin-nav-user .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .admin-layout {
        flex-direction: column;
        position: relative;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transition: left 0.3s ease;
        padding-top: 80px;
    }

    .admin-sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .admin-main {
        padding: 1rem;
        min-height: calc(100vh - 80px);
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .section-header h3 {
        font-size: 1.5rem;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .item-header {
        flex-direction: column;
        gap: 1rem;
    }

    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .item-actions .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .menu-item {
        min-height: 48px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }

    .btn {
        min-height: 44px;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        margin: 0;
        border-radius: 15px;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-content form {
        padding: 1rem 1.5rem;
    }

    .login-box {
        padding: 2rem;
        margin: 1rem;
    }

    .login-header i {
        font-size: 3rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .settings-card {
        padding: 1.5rem;
    }

    .settings-card .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-sidebar {
        width: 220px;
    }

    .admin-main {
        padding: 1.5rem;
    }
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.d-none { display: none; }
.d-block { display: block; }
