/* assets/css/style.css */

/* --- Universal Styles & Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f8f9fa;
    margin: 0;
    color: #343a40;
    font-size: 16px;
}

h1, h2, h3 {
    color: #212529;
}

.page-header {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 1rem;
}

/* --- Main Layout Structure --- */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.content {
    width: 100%;
    padding: 20px 40px;
    min-height: 100vh;
    transition: all 0.3s;
}

/* --- Sidebar Navigation --- */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #343a40;
    color: #fff;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    background: #212529;
    text-align: center;
}

.sidebar ul.components {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 1.1em;
    display: block;
    color: #adb5bd;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.sidebar ul li a:hover {
    color: #ffffff;
    background: #495057;
}

.admin-link a {
    background: #c79100;
    color: #fff !important;
}

/* --- Tables (Desktop First) --- */
.styled-table {
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95em;
    width: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden; /* Important for border-radius */
}

.styled-table thead tr {
    background-color: #343a40;
    color: #ffffff;
    text-align: left;
    font-weight: bold;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
}

.styled-table tbody tr {
    border-bottom: 1px solid #dddddd;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

.styled-table tbody tr:last-of-type {
    border-bottom: 2px solid #343a40;
}

.styled-table tbody tr:hover {
    background-color: #e9ecef;
}

/* --- Forms & Buttons --- */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
    outline: none;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: black;
    display: inline-block;
    transition: opacity 0.3s, transform 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary { background-color: #007bff; }
.btn-success { background-color: #28a745; }
.btn-danger { background-color: #dc3545; }
.btn-warning { background-color: #ffc107; }

/* --- Admin Dashboard Cards --- */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    min-width: 220px;
}

.card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #555;
}

.card p.metric {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
    margin: 0;
}

/* --- Mobile Responsive Design --- */
/* This section overrides the styles above ONLY on screens smaller than 768px */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        min-width: 100%;
        max-width: 100%;
        height: auto;
    }

    .sidebar ul.components {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .sidebar ul li a {
        padding: 10px 15px;
        white-space: nowrap;
    }

    .content {
        padding: 15px;
    }

    .page-header {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    /* Responsive Table Styling */
    .styled-table thead {
        display: none; /* Hide desktop headers */
    }

    .styled-table tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border: 1px solid #ddd;
    }
    
    .styled-table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }
    
    .styled-table td:last-child {
        border-bottom: none;
    }

    .styled-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
    }
}


.location-tag {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff; /* Blue background */
    border-radius: 10px;
}