/* ===========================
   ADMIN PANEL CSS - IMPROVED
   Bowhunters Wartau
   =========================== */

:root {
    --primary-green: #2d4a2b;
    --accent-brown: #5d4e37;
    --light-brown: #8b7355;
    --beige: #f5f1e8;
    --dark-text: #1a1a1a;
    --light-gray: #f4f4f4;
    --border-color: #ddd;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196F3;
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--beige);
    color: var(--dark-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===========================
   LOADING SPINNER
   =========================== */

.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
    color: var(--primary-green);
}

/* ===========================
   ALERTS
   =========================== */

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert i {
    font-size: 1.3rem;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid var(--info);
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: #ffebee;
    color: #b71c1c;
    border-left: 4px solid var(--danger);
}

/* ===========================
   NOTIFICATION TOAST
   =========================== */

.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.notification-toast.show {
    display: flex;
}

.notification-toast.error {
    background: var(--danger);
}

.notification-toast i {
    font-size: 1.3rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ===========================
   LOGIN PAGE - IMPROVED
   =========================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-brown) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.login-logo {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--accent-brown);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

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

.error-message {
    background: #ffebee;
    color: var(--danger);
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ===========================
   ADMIN LAYOUT
   =========================== */

.admin-container {
    display: none;
}

.admin-container.active {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: 260px;
    background: var(--primary-green);
    color: white;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.sidebar-menu a.active {
    background: var(--accent-brown);
    border-left: 4px solid white;
}

.sidebar-menu i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-logout {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 20px;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* MAIN CONTENT */
.admin-main {
    margin-left: 260px;
    flex: 1;
    background: var(--light-gray);
}

.admin-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-green);
    font-size: 1.8rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-brown);
}

.admin-content {
    padding: 30px;
}

/* ===========================
   DASHBOARD CARDS
   =========================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.green {
    background: rgba(45, 74, 43, 0.1);
    color: var(--primary-green);
}

.stat-icon.brown {
    background: rgba(93, 78, 55, 0.1);
    color: var(--accent-brown);
}

.stat-icon.blue {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
}

.stat-icon.orange {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

/* ===========================
   CONTENT SECTIONS
   =========================== */

.admin-section {
    display: none;
}

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

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

.section-title {
    font-family: 'Cinzel', serif;
    color: var(--primary-green);
    font-size: 1.8rem;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.content-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

/* ===========================
   TABLES
   =========================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: var(--primary-green);
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: rgba(45, 74, 43, 0.05);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.badge.warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning);
}

.badge.danger {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
}

.badge.info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-edit {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
}

.btn-edit:hover {
    background: var(--info);
    color: white;
}

.btn-delete {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
}

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

.btn-view {
    background: rgba(45, 74, 43, 0.1);
    color: var(--primary-green);
}

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

/* ===========================
   MODAL
   =========================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-title {
    font-family: 'Cinzel', serif;
    color: var(--primary-green);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 10px 0;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    padding: 12px 24px;
    background: #999;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #777;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 968px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-main {
        margin-left: 200px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-header {
        padding: 15px 20px;
    }
    
    .admin-header h1 {
        font-size: 1.3rem;
    }
    
    .admin-content {
        padding: 20px 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* ===========================
   LOADING SPINNER
   =========================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   UTILITIES
   =========================== */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}
