/* Custom styles for SDO Masbate City DTR System */

/* Use system friendly modern font (Inter loaded in layout.php) */
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; color: #222; }

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #2d572c 0%, #4caf50 100%);
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.header img {
    max-width: 120px;
    height: auto;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 300;
}

.header p {
    margin: 5px 0 0 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.navbar li {
    margin: 0;
}

.navbar a {
    display: block;
    padding: 15px 20px;
    color: #2d572c;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.navbar a:hover {
    background-color: #f8f9fa;
    color: #4caf50;
    border-bottom-color: #4caf50;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.content {
    text-align: center;
    padding: 40px 20px;
}

footer {
    text-align: center;
    padding: 20px;
    background: linear-gradient(180deg,#0b3f17,#092f12);
    color: #fff;
    margin-top: 50px;
}

/* Form Styles */
.form-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background-color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border-radius: 12px;
    margin: 40px auto;
}

.form-container h1, .form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d572c;
    font-weight: 300;
}

.form-container label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-container input, .form-container select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-container input:focus, .form-container select:focus {
    border-color: #4caf50;
    outline: none;
}

.form-container button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2d572c 0%, #4caf50 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 87, 44, 0.3);
}

.notification {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
}

.notification.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Dashboard Styles */
.dashboard-container, .management-container {
    background-color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.dashboard-header, .management-header {
    text-align: center;
    margin-bottom: 30px;
}

.dashboard-header h1, .dashboard-header h2, .management-header h1, .management-header h2 {
    margin: 0 0 10px 0;
    color: #2d572c;
    font-weight: 300;
}

.nav-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: block;
    padding: 20px;
    background: linear-gradient(135deg, #2d572c 0%, #4caf50 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(45, 87, 44, 0.3);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

table th, table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: linear-gradient(90deg,#f0fbf3,#e8f7e9);
    color: #0b5e23;
    font-weight: 600;
    border-bottom: none;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e8f5e8;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons a, .action-buttons button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #2d572c 0%, #4caf50 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-buttons a:hover, .action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 87, 44, 0.3);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.search-form input:focus {
    border-color: #4caf50;
    outline: none;
}

.search-form button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2d572c 0%, #4caf50 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.search-form button:hover {
    transform: translateY(-2px);
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #4caf50;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    color: #666;
}

/* Empty state */
.empty-state { padding: 2.5rem 1rem; }

/* Utilities */
.text-muted { color: #6b7280 !important; }
.small { font-size: .85rem; }

/* Pagination styling */
.pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}
.page-item { display: inline-block; }
.page-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e6ece3;
    background: #fff;
    color: #0b5e23;
    text-decoration: none;
}
.page-link:hover { background: #f1f5f9; color: #0b5e23; }
.page-item.active .page-link {
    background: linear-gradient(180deg,#2d7f2f,#1f6b25);
    color: #fff;
    border-color: #1f6b25;
}
.page-item.disabled .page-link { color: #9aa7a0; pointer-events: none; background: #fff; }

/* Navbar toggler fallback icon */
.navbar-toggler { border: none; background: transparent; padding: .25rem .5rem; }
.navbar-toggler-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1rem;
    position: relative;
}
.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon span {
    content: '';
    display: block;
    height: 2px;
    width: 100%;
    background: #333;
    position: absolute;
    left: 0;
}
.navbar-toggler-icon::before { top: 0; }
.navbar-toggler-icon span { top: 4px; }
.navbar-toggler-icon::after { bottom: 0; }

/* Collapse fallback: make collapsed content stack on small screens */
.collapse { display: flex; flex-direction: row; align-items: center; gap: 1rem; }
.collapse.show { display: flex; flex-direction: column; align-items: stretch; }

/* Ensure navbar links look button-like on small screens when expanded */
@media (max-width: 767px) {
    .collapse.show .nav-link { padding: .5rem 0; border-bottom: 1px solid #eee; }
    .collapse.show .navbar-nav { flex-direction: column; gap: .25rem; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .navbar ul {
        flex-direction: column;
    }

    .navbar a {
        padding: 12px 15px;
        border-bottom: none;
        border-top: 1px solid #e0e0e0;
    }

    .navbar a:first-child {
        border-top: none;
    }

    .container {
        margin: 20px auto;
        padding: 0 10px;
    }

    .dashboard-container, .management-container {
        padding: 20px;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }

    table th, table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons a, .action-buttons button {
        text-align: center;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .form-container {
        padding: 20px;
        margin: 20px auto;
    }

    .dashboard-header h1, .management-header h1 {
        font-size: 1.5em;
    }

    table {
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    .card { margin-bottom: 1rem; }
}

/* Layout helpers: keep footer below content even on short pages */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main.container { flex: 1 0 auto; }
footer { flex-shrink: 0; }
