/* The Drop of Life - Blood Donation System CSS */

/* Variables */
:root {
    --primary: #dc3545;
    --primary-light: #f5c6cb;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */

.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--primary-light);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
    max-width: 1200px;
}

.header__logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__nav {
    display: flex;
    align-items: center;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav__item {
    margin: 0;
}

.nav__link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    position: relative;
}

.nav__link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.header__mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.hamburger__line {
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    transition: 0.3s;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .header__mobile-toggle {
        display: flex;
    }
    
    .nav__list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .nav__list--mobile-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav__link {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--gray-100);
    }
}

/* Page Header */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

.page-header__content {
    flex: 1;
    text-align: center;
}

.page-header__content h1 {
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.page-header > button:first-child {
    flex-shrink: 0;
}

.page-header > a:last-child {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 0.5rem;
    }
    
    .page-header > * {
        align-self: stretch;
        text-align: center;
    }
}

.page-subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
    text-align: center;
}

/* Hero Section */

.hero {
    background: linear-gradient(135deg, var(--primary), #b91c3c);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero__title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 44px;
    box-sizing: border-box;
}

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

.btn--primary:hover {
    background: #b91c3c;
    transform: translateY(-2px);
}

.btn--secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn--secondary:hover {
    background: var(--gray-700);
}

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

.btn--white:hover {
    background: var(--gray-50);
}

.btn--outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn--outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

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

.btn--outline.btn--danger {
    background: var(--white);
    color: #ef4444;
    border-color: #ef4444;
}

.btn--outline.btn--danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

.btn--sm {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 44px;
}

.btn--lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    min-height: 44px;
}

/* Cards */

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.stat-card__number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card__label {
    color: var(--gray-600);
    font-weight: 500;
}

/* Forms */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Tables */

.table-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
}

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

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

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Mobile table responsiveness */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px; /* Ensure table doesn't collapse too much */
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Add scroll indicator shadow */
    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
        pointer-events: none;
    }
}

/* Alerts */

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

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

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

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

/* Blood Types */

.blood-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.875rem;
    color: white;
    min-width: 50px;
    text-align: center;
}

.blood-type-o-pos { background: #dc3545; }
.blood-type-o-neg { background: #c82333; }
.blood-type-a-pos { background: #28a745; }
.blood-type-a-neg { background: #1e7e34; }
.blood-type-b-pos { background: #007bff; }
.blood-type-b-neg { background: #0056b3; }
.blood-type-ab-pos { background: #ffc107; }
.blood-type-ab-neg { background: #e0a800; }

/* Footer */

.footer {
    background: var(--gray-800);
    color: var(--white);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

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

.footer__section h3 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer__section p {
    margin-bottom: 0.5rem;
    color: var(--gray-300);
    line-height: 1.6;
}

.footer__section a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s;
}

.footer__section a:hover {
    color: var(--primary-light);
}

.footer__bottom {
    border-top: 1px solid var(--gray-600);
    padding-top: 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Utilities */

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

.mb-3 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1.5rem; }

/* Responsive */

@media (max-width: 768px) {
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Additional utility classes */

.filter-form {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

