/* 
   Blood Donation Portal - VSSPBD Styled Responsive Design
   Modern, Mobile-First Responsive Stylesheet
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b000e;
    --secondary-color: #8b000e;
    --accent-color: #8b000e;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #690B2C;
}

body {
    font-family: 'Century', 'Century Gothic', 'Century Schoolbook', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

/* Container for content width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Contact Bar */
.top-bar {
    background-color: var(--dark-color);
    color: white;
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 30px;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-info i {
    color: var(--primary-color);
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #c82333 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 46px;
    height: 46px;
    font-size: 0;
    flex-shrink: 0;
    background: url('vssp_logo.jpg') center/contain no-repeat;
    animation: none;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 0.9rem;
    opacity: 0.95;
    line-height: 1.2;
    margin: 0;
}

.logo-text .subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    display: block;
    margin-top: 5px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.admin-link {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #761010 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 120px 0 60px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0 L1200,0 L1200,60 Q900,90 600,60 T0,60 Z" fill="rgba(255,255,255,0.1)"/></svg>') repeat-x bottom;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 50px;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-buttons .btn {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    padding: clamp(12px, 1.8vw, 16px) clamp(24px, 2.5vw, 32px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main content area */
main {
    padding: 60px 0;
}

/* Info Section */
.info-section {
    margin-bottom: 60px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.info-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.info-card p {
    color: #666;
    line-height: 1.8;
}

.info-card ul {
    list-style: none;
    text-align: left;
    color: #666;
}

.info-card li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card li i {
    color: var(--success-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-download {
    background: white;
    color: #667eea;
    font-weight: 700;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* App Download Section */
.app-download-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    margin: 60px 0;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.app-content {
    max-width: 600px;
    margin: 0 auto;
}

.app-icon-large {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.app-download-section h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 15px;
}

.app-download-section p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.95;
}

.app-note {
    font-size: 0.9rem !important;
    margin-top: 15px !important;
    opacity: 0.8 !important;
}

/* Blood Types Section */
.blood-types-section {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin: 60px 0;
}

.section-title {
    color: var(--primary-color);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
}

.compatibility-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.compatibility-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.compatibility-table th {
    color: white;
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.compatibility-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.compatibility-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.blood-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    /* Top Bar */
    .top-bar {
        display: none;
    }
    
    /* Header */
    .logo-section {
        gap: 10px;
    }
    
    .logo-icon {
        width: 48px;
        height: 48px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
        line-height: 1.1;
        margin-bottom: 2px;
    }
    
    .logo-text p {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    
    .logo-text .subtitle {
        font-size: 0.65rem;
        margin-top: 2px;
    }
    
    /* Mobile Menu */
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 5px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .mobile-menu-close {
        display: block;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-radius: 8px;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Info Grid */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* App Section */
    .app-download-section {
        padding: 40px 20px;
    }
    
    .app-icon-large {
        font-size: 3.5rem;
    }
    
    .app-download-section h3 {
        font-size: 1.5rem;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: scroll;
    }
    
    .compatibility-table {
        font-size: 0.9rem;
    }
    
    .compatibility-table th,
    .compatibility-table td {
        padding: 12px 10px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 60px 0 40px;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

/* Admin Dashboard Specific Styles */
.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* Tables - Enhanced for Admin */
.table-container {
    background-color: white;
    border-radius: 15px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-top: 20px;
    position: relative;
    max-width: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* Scrollbar styling for table container */
.table-container::-webkit-scrollbar {
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c0392b;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a93226;
}

/* Forms */
.form-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-section h2 {
    color: #c0392b;
    margin-bottom: 1.5rem;
}

.donor-form, .login-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #c0392b;
}

/* Filter form */
.filter-form {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.filter-group input,
.filter-group select {
    padding: 0.6rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Info box */
.info-box {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.info-box h3 {
    color: #856404;
    margin-bottom: 1rem;
}

.info-box ul {
    list-style-position: inside;
    color: #856404;
}

/* Blood badge */
.blood-badge {
    display: inline-block;
    background-color: #c0392b;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Status badges */
.status-eligible {
    color: #27ae60;
    font-weight: bold;
}

.status-waiting {
    color: #e67e22;
    font-weight: bold;
}

/* Donors count */
.donors-count {
    background-color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.donors-count p {
    font-weight: bold;
    color: #c0392b;
}

/* Login section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background-color: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #c0392b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.login-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Admin dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #c0392b;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.blood-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.blood-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Admin table */
.admin-table {
    font-size: 0.95rem;
    min-width: 1600px;
    white-space: nowrap;
    border-collapse: collapse;
}

.admin-table th {
    font-size: 0.9rem;
    padding: 1rem 0.8rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #c0392b;
    color: white;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #a93226;
}

.admin-table td {
    padding: 0.9rem 0.8rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Specific column width adjustments for better fit */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 50px;
    text-align: center;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    min-width: 130px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    min-width: 150px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    min-width: 120px;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 80px;
    text-align: center;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
    min-width: 180px;
}

.admin-table th:nth-child(7),
.admin-table td:nth-child(7) {
    min-width: 110px;
}

.admin-table th:nth-child(8),
.admin-table td:nth-child(8) {
    min-width: 120px;
}

.admin-table th:nth-child(9),
.admin-table td:nth-child(9) {
    width: 100px;
    text-align: center;
}

.admin-table th:nth-child(10),
.admin-table td:nth-child(10) {
    width: 100px;
    text-align: center;
}

.admin-table th:nth-child(11),
.admin-table td:nth-child(11) {
    width: 90px;
    text-align: center;
}

.admin-table th:nth-child(12),
.admin-table td:nth-child(12) {
    min-width: 120px;
}

.admin-table th:nth-child(13),
.admin-table td:nth-child(13) {
    min-width: 180px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Edit row */
.edit-row {
    background-color: #ecf0f1;
}

.inline-edit-form {
    padding: 1.5rem;
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.edit-grid label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.edit-grid input,
.edit-grid select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Footer */
footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* ================================
   NEW STYLES FOR ADDITIONAL FEATURES
   ================================ */

/* Form improvements */
.form-wide {
    max-width: 800px;
}

.form-intro {
    color: #666;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #c0392b;
}

.required {
    color: #c0392b;
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.3rem;
}

/* Filter grid improvements */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-weight: bold;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.filter-item input,
.filter-item select {
    padding: 0.6rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Export button */
.btn-export {
    background-color: #27ae60;
    color: white;
}

.btn-export:hover {
    background-color: #219a52;
}

/* Success button */
.btn-success {
    background-color: #27ae60;
    color: white;
    border-radius: 4px;
}

.btn-success:hover {
    background-color: #219a52;
}

/* Certificate button */
.btn-certificate {
    background-color: #9b59b6;
    color: white;
    border-radius: 4px;
}

.btn-certificate:hover {
    background-color: #8e44ad;
}

/* Contact info in tables */
.contact-info {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.contact-info span {
    display: block;
}

/* Contact page styles */
.contact-info-box {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.contact-info-box h3 {
    color: #c0392b;
    margin-bottom: 1rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-method {
    display: flex;
    gap: 0.5rem;
}

.contact-method strong {
    min-width: 60px;
}

/* FAQ page styles */
.faq-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.faq-intro {
    color: #666;
    margin-bottom: 2rem;
}

.faq-intro a {
    color: #c0392b;
}

.faq-category {
    margin-bottom: 2rem;
}

.faq-category h3 {
    color: #c0392b;
    border-bottom: 2px solid #c0392b;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.faq-question {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.faq-answer {
    color: #555;
    line-height: 1.7;
}

.faq-answer ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.3rem;
}

.faq-answer a {
    color: #c0392b;
}

.faq-cta {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

.faq-cta h3 {
    color: #c0392b;
    margin-bottom: 0.5rem;
}

.faq-cta p {
    color: #666;
    margin-bottom: 1rem;
}

/* Admin settings styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-card h3 {
    color: #c0392b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
}

.info-label {
    color: #777;
}

.info-value {
    font-weight: bold;
    color: #2c3e50;
}

.settings-form .form-group {
    margin-bottom: 1rem;
}

.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quick-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.stat-label {
    color: #555;
}

.stat-value {
    font-weight: bold;
    color: #c0392b;
}

/* Contact messages styles */
.message-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.message-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #bdc3c7;
}

.message-card.unread {
    border-left-color: #c0392b;
    background-color: #fdf8f8;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-sender {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.message-email,
.message-phone {
    font-size: 0.85rem;
    color: #777;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-date {
    font-size: 0.85rem;
    color: #999;
}

.unread-badge {
    background-color: #c0392b;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.message-subject {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.message-content {
    color: #555;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Blood requests styles */
.request-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
    flex-wrap: wrap;
}

.request-stats .stat-item {
    display: flex;
    gap: 0.5rem;
}

.urgent-text {
    color: #e74c3c;
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.request-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #27ae60;
}

.request-card.urgency-urgent {
    border-left-color: #f39c12;
}

.request-card.urgency-critical {
    border-left-color: #e74c3c;
    background-color: #fef5f5;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.request-blood-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.units-needed {
    font-weight: bold;
    color: #2c3e50;
}

.request-badges {
    display: flex;
    gap: 0.5rem;
}

.urgency-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
}

.urgency-badge.urgency-normal {
    background-color: #27ae60;
    color: white;
}

.urgency-badge.urgency-urgent {
    background-color: #f39c12;
    color: white;
}

.urgency-badge.urgency-critical {
    background-color: #e74c3c;
    color: white;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

.status-badge.status-pending {
    background-color: #3498db;
    color: white;
}

.status-badge.status-fulfilled {
    background-color: #27ae60;
    color: white;
}

.status-badge.status-cancelled {
    background-color: #95a5a6;
    color: white;
}

.request-details {
    margin-bottom: 1rem;
}

.detail-row {
    padding: 0.3rem 0;
    color: #555;
}

.detail-row.needed-by {
    background-color: #fef9e7;
    padding: 0.5rem 0.8rem;
    border-left: 3px solid #f39c12;
    margin: 0.5rem 0;
}

.date-warning {
    font-weight: bold;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.date-warning.overdue {
    color: #c0392b;
    background-color: #fce4e4;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.date-warning.today {
    color: #e74c3c;
    background-color: #fdedec;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.date-warning.tomorrow {
    color: #d35400;
    background-color: #fef5e7;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.date-warning.soon {
    color: #f39c12;
    background-color: #fef9e7;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.detail-row.meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

/* Responsive additions */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    table th,
    table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .table-container {
        margin: 15px 0;
        border-radius: 10px;
        box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    }
    
    .admin-table {
        min-width: 1400px;
        font-size: 0.85rem;
    }
    
    .admin-table th {
        padding: 0.8rem 0.6rem;
        font-size: 0.8rem;
        position: sticky;
        top: 0;
        background-color: #c0392b;
    }
    
    .admin-table td {
        padding: 0.7rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Make action buttons stack vertically on mobile */
    .admin-table .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        min-width: 120px;
    }
    
    .admin-table .btn-small {
        width: 100%;
        text-align: center;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .action-buttons .btn-small {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    .edit-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .message-header {
        flex-direction: column;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Make nav responsive */
    nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    
    /* Responsive container */
    .container {
        padding: 0 10px;
    }
    
    /* Stats grid responsive */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Header responsive */
    header h1 {
        font-size: 1.3rem;
    }
    
    /* Info grid responsive */
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    /* Form responsive */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Filter form responsive */
    .filter-form {
        padding: 1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* QR Code Success Section */
.qr-success-section {
    margin: 2rem 0;
}

.qr-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-top: 5px solid #27ae60;
}

.qr-card h3 {
    color: #27ae60;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.qr-card > p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.qr-code-box {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.qr-image {
    max-width: 250px;
    height: auto;
    display: block;
}

.donor-code-display {
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.donor-code-display .label {
    color: #7f8c8d;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.3rem;
}

.donor-code-display .code {
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: #c0392b;
    letter-spacing: 2px;
}

.qr-instructions {
    text-align: left;
    background: #e8f6f3;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.qr-instructions h4 {
    color: #1e8449;
    margin-bottom: 0.8rem;
}

.qr-instructions ol {
    margin-left: 1.5rem;
    color: #2c3e50;
}

.qr-instructions li {
    margin-bottom: 0.5rem;
}

.qr-note {
    background: #fef9e7;
    padding: 1rem;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.qr-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Accepted Donor Info */
.accepted-donor-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    color: #155724;
}

.accepted-donor-info a {
    color: #155724;
    font-weight: bold;
}

/* Status Accepted */
.status-accepted {
    background-color: #d4edda;
    color: #155724;
}

/* Notify Button */
.btn-notify {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.btn-notify:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
}

/* Donor Code in Table */
.donor-code-small {
    font-family: monospace;
    font-size: 0.75rem;
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 4px;
    color: #7f8c8d;
    display: block;
    margin-bottom: 5px;
    word-break: break-all;
}

.btn-qr {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white !important;
}

.btn-qr:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6aa5 100%);
}

.text-muted {
    color: #95a5a6;
    font-size: 0.85rem;
    font-style: italic;
}

/* Donors Table */
.donors-table {
    min-width: 100px;
    white-space: nowrap;
}

.donors-table th {
    padding: 0.8rem 0.6rem;
    white-space: nowrap;
    font-size: 0.85rem;
}

.donors-table td {
    padding: 0.7rem 0.6rem;
    font-size: 0.85rem;
}

/* Contact info in table */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
}

.contact-info span {
    white-space: normal;
    word-break: break-word;
}

/* Responsive improvements for small screens */
@media (max-width: 480px) {
    .admin-table,
    .donors-table {
        min-width: 100px;
        font-size: 0.7rem;
    }
    
    .admin-table th,
    .admin-table td,
    .donors-table th,
    .donors-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .blood-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .btn-small {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }
}


/* Forms */
.form-section {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 40px auto;
}

.form-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
}

.form-intro {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.donor-form, .login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.required {
    color: var(--primary-color);
}

/* Messages */
.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Dashboard Section */
.dashboard-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    color: var(--dark-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Admin Table */
.admin-table {
    width: 100%;
    font-size: 0.95rem;
}

.admin-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Stat Card Icon */
.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ===================================
   PWA INSTALLATION BANNER STYLES
   =================================== */

.pwa-install-banner {
    background: linear-gradient(135deg, #8b000e 0%, #c62828 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 999;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.pwa-banner-icon {
    font-size: 2.5rem;
    color: white;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    min-width: 200px;
}

.pwa-banner-text h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.pwa-banner-text p {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-install {
    background: white;
    color: #8b000e;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-install:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-install i {
    font-size: 1.1rem;
}

.btn-close-banner {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-close-banner:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* PWA Standalone Mode Adjustments */
.standalone-mode body {
    /* Ensure content respects system UI areas (status bar, navigation bar) */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Offline Mode Indicator */
.offline-mode::before {
    content: "⚠️ You are offline - Some features may be limited";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 10000;
    font-size: 0.9rem;
    font-weight: 600;
}

.offline-mode .main-header {
    margin-top: 40px;
}

/* PWA Installation Button in Menu */
.install-app-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #8b000e 0%, #c62828 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 2px 10px rgba(139, 0, 14, 0.3);
}

.install-app-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 0, 14, 0.4);
}

.install-app-button i {
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }

    .pwa-banner-content {
        justify-content: center;
        text-align: center;
    }

    .pwa-banner-icon {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .form-section {
        padding: 30px 20px;
    }
    
    .dashboard-section {
        padding: 30px 20px;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }

    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .pwa-banner-icon {
        font-size: 2.5rem;
    }

    .pwa-banner-text {
        min-width: auto;
    }

    .pwa-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-install {
        width: 100%;
        justify-content: center;
    }

    .btn-close-banner {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .pwa-install-banner {
        position: relative;
    }
}

@media (max-width: 480px) {
    .pwa-banner-text h3 {
        font-size: 1.1rem;
    }

    .pwa-banner-text p {
        font-size: 0.85rem;
    }

    .btn-install {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
