/* public/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4CAF50; /* Green */
    --primary-dark-color: #388E3C;
    --secondary-color: #007bff; /* Blue */
    --secondary-dark-color: #0056b3;
    --danger-color: #dc3545; /* Red */
    --info-color: #17a2b8; /* Cyan */
    --warning-color: #ffc107; /* Yellow */
    --light-bg: #f8f9fa;
    --dark-text: #343a40;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    flex: 1; /* Allows main content to grow */
}

/* Navbar */
.navbar {
    background-color: var(--primary-dark-color);
    color: white;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
    align-items: center;
}

.navbar-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.navbar-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Auth Card (Login) */
.auth-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    padding: 40px;
    max-width: 450px;
    margin: 80px auto;
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 20px;
    color: var(--primary-dark-color);
}

.auth-card p {
    margin-bottom: 25px;
    color: #666;
}

.auth-card .admin-link {
    margin-top: 25px;
    font-size: 0.9em;
}
.auth-card .admin-link a {
    color: var(--secondary-color);
    text-decoration: none;
}
.auth-card .admin-link a:hover {
    text-decoration: underline;
}


/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-text);
}

.form-control, .form-control-file, .form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2); /* primary-color with transparency */
}

textarea.form-control {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.85em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
}


/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    padding: 30px;
    margin-bottom: 20px;
}

.card h3 {
    color: var(--primary-dark-color);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Page Header */
.page-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
    text-align: center;
}

.page-header h2 {
    margin: 0;
    font-size: 2rem;
}

/* Info Grid (for Dashboard) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding-top: 10px;
}

.info-grid p {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-grid p strong {
    color: var(--primary-dark-color);
}

/* Badge for leave balance/status */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    background-color: var(--secondary-color); /* Default blue */
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    display: inline-block;
}

.status-requested { background-color: #ffc107; } /* Warning yellow */
.status-checked { background-color: #17a2b8; }    /* Info cyan */
.status-approved { background-color: #28a745; }   /* Success green */
.status-pending { background-color: #6c757d; }    /* Secondary gray */
.status-denied { background-color: #dc3545; }     /* Danger red */

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

.data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.data-table tr:hover {
    background-color: #e9ecef;
}

/* Memo Specific Styles */
.memo-section {
    margin-bottom: 40px;
}

.memo-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.memo-item {
    background-color: var(--card-bg);
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    position: relative;
}

.memo-item h4 {
    margin-top: 0;
    color: var(--primary-dark-color);
    margin-bottom: 10px;
}

.memo-item p {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.memo-item .memo-status {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* Dashboard Grid for Admin */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dashboard-card {
    text-align: center;
    padding: 30px;
    border-left: 8px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.dashboard-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-dark-color);
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-card .big-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-dark-color);
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background-color: var(--dark-text);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto; /* Pushes footer to the bottom */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 15px;
    }

    .navbar-nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        gap: 8px;
    }

    .navbar-nav ul li {
        width: 100%;
    }

    .navbar-nav ul li a {
        display: block;
        text-align: center;
    }

    .container {
        padding: 0 15px;
    }

    .form-grid, .info-grid, .memo-list, .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 25px;
        margin: 40px auto;
    }

    .table-responsive {
        width: 100%; /* Ensure table doesn't overflow on small screens */
    }
}

