/* ========== ROOT & GENERAL STYLES ========== */
:root {
    --primary-red: #c41e3a;
    --dark-red: #8b1428;
    --light-red: #e74c3c;
    --cream-bg: #faf6f1;
    --dark-text: #2c1810;
    --light-text: #6f5f54;
    --border-color: #d4a5a5;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
}

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

html {
    font-size: 16px;
}

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

/* ========== HEADER & NAVIGATION ========== */
header {
    background-color: var(--primary-red);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: var(--cream-bg);
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    color: var(--cream-bg);
    transform: translateY(-2px);
}

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

.logout-btn {
    background-color: var(--dark-red);
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: var(--light-red);
    transform: scale(1.05);
}

/* ========== CONTAINER & LAYOUT ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .content {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.1);
    border-left: 4px solid var(--primary-red);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.15);
    /* transform: translateY(-4px); */
}

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

.card-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-red);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 0.5rem;
}

/* ========== FORMS ========== */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

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

.btn-primary:hover {
    background-color: var(--dark-red);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

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

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

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

.btn-success:hover {
    background-color: #229954;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

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

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ========== ALERTS & MESSAGES ========== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: var(--success);
}

.alert-error,
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: var(--danger);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: var(--warning);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.error-list {
    list-style: none;
}

.error-list li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.error-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #721c24;
    font-weight: bold;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

thead {
    background-color: var(--primary-red);
    color: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.3s ease;
}

tbody tr:hover {
    background-color: rgba(196, 30, 58, 0.05);
}

tbody tr:nth-child(even) {
    background-color: rgba(196, 30, 58, 0.02);
}

/* ========== BADGES & TAGS ========== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-primary {
    background-color: rgba(196, 30, 58, 0.2);
    color: var(--dark-red);
}

.badge-success {
    background-color: rgba(39, 174, 96, 0.2);
    color: #229954;
}

.badge-warning {
    background-color: rgba(243, 156, 18, 0.2);
    color: #d68910;
}

.badge-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.badge-pending {
    background-color: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-red);
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--primary-red);
    color: white;
}

.pagination .active {
    background-color: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== DASHBOARD STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.1);
    border-top: 4px solid var(--primary-red);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-red);
}

.stat-label {
    color: var(--light-text);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ========== SEARCH & FILTER ========== */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.search-input input {
    width: 100%;
}

.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-group select {
    min-width: 150px;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 2rem;
    text-align: center;
}

.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-toggle a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* ========== FORM VIEW ========== */
.form-view {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.1);
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field-label {
    font-weight: 600;
    color: var(--primary-red);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.form-field-value {
    padding: 0.75rem 1rem;
    background-color: var(--cream-bg);
    border-radius: 4px;
    color: var(--dark-text);
    word-break: break-word;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.file-item {
    background-color: var(--cream-bg);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--primary-red);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-item a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.file-item a:hover {
    text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input {
        min-width: auto;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 0.75rem;
    }

    .login-card {
        padding: 2rem;
        width: 90%;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    header,
    .btn,
    .search-bar {
        display: none;
    }

    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
