/* --- General Hospital Page Styles --- */
:root {
    --hospital-card-bg: var(--color-card-bg, #fff);
    --hospital-border: var(--color-border, #e0e0e0);
}

.user-panel {
    max-width: 800px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--hospital-card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#welcome-message {
    font-weight: 500;
    color: #333;
}

#logout-button {
    background: none;
    border: 1px solid #d9534f;
    color: #d9534f;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#logout-button:hover {
    background-color: #d9534f;
    color: #fff;
}

.form-container {
    max-width: 800px;
    margin: 1rem auto;
    background: var(--hospital-card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.form-container p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

/* --- My Requests & Pledges --- */
.my-pledges { max-width: 800px; margin: 1rem auto 2rem; }
.my-pledges h2 { margin: 0 0 0.5rem; }

.request-group {
    background-color: var(--hospital-card-bg);
    border: 1px solid var(--hospital-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.request-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background-color: var(--color-table-alt);
    font-size: 1.05rem;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.request-group .blood-type { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }
.request-group .units { color: var(--color-text); }
.request-group .request-date { margin-left: auto; color: var(--color-muted); font-size: 0.9rem; }

.pledge-list { padding: 0; border-top: 1px solid var(--hospital-border); max-height: 0; overflow: hidden; opacity: 0; transition: max-height 250ms ease, opacity 180ms ease; }
.request-group[open] .pledge-list { max-height: 1000px; opacity: 1; }

.pledge-list table { width: 100%; border-collapse: collapse; }
.pledge-list th, .pledge-list td { padding: 0.9rem 1.25rem; text-align: left; border-bottom: 1px solid #eee; }
.pledge-list thead { background: #f5f5f5; color: #333; }
.pledge-list tbody tr:nth-child(even) { background-color: var(--color-table-alt); }
.pledge-list a[href^="tel"] { color: var(--color-info); text-decoration: none; font-weight: 500; }
.no-pledges { padding: 1rem 1.25rem; color: var(--color-muted); font-style: italic; }

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

/* --- New Blood Group Selector Styles --- */
.blood-group-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.blood-card {
    border: 2px solid var(--hospital-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.blood-card:hover, .blood-card:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    outline: none;
}

.blood-card.selected {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 8px rgba(217, 83, 79, 0.3);
}


/* --- Form Input and Button Styles --- */
#request-form input[type="text"],
#request-form input[type="number"],
#request-form input[type="tel"] {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    box-sizing: border-box; /* Important for padding */
    background: transparent;
    color: inherit;
}

#request-form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background-color: var(--color-success);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#request-form button[type="submit"]:hover {
    background-color: #4cae4c;
}

/* --- Login Page Styles (Included for completeness) --- */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container header h1 {
    font-size: 1.5rem;
    color: #d9534f;
}

.login-container header h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#login-button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    color: white;
    background-color: #0275d8;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#login-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.error-message {
    color: #d9534f;
    margin-top: 1rem;
    min-height: 1.2em; /* Prevents layout shift */
}

.login-container footer {
    margin-top: 2rem;
}

/* --- Responsive Adjustments --- */
@media screen and (max-width: 768px) {
    .user-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    #logout-button {
        width: 100%;
    }

    .form-container {
        margin: 0.75rem;
        padding: 1rem;
    }

    .blood-group-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .blood-card {
        font-size: 1rem;
        padding: 0.8rem;
    }
}

@media screen and (max-width: 420px) {
    .blood-group-selector {
        grid-template-columns: 1fr;
    }

    .user-panel {
        gap: 0.4rem;
    }
}
