/**
 * Capacity Statistics & Bed Booking Styles
 * Albahira Hospital Ecosystem - Refined Visual Identity
 */

/* ═══════════════════════════════════════════════════════
   HOMEPAGE CAPACITY STATISTICS SECTION
   ═══════════════════════════════════════════════════════ */

.pd-capacity-section {
    background: linear-gradient(180deg, #FEF9F3 0%, #FFFFFF 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.pd-capacity-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(175, 196, 162, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.pd-capacity-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(22, 78, 61, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.pd-capacity-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.pd-capacity-label {
    display: inline-block;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #AFC4A2;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Cairo', 'Open Sans', sans-serif;
}

.pd-capacity-title {
    color: #164E3D;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    font-family: 'Cairo', 'Amiri', serif;
    margin: 0 0 12px;
    line-height: 1.3;
}

.pd-capacity-subtitle {
    color: #5A5A5A;
    font-size: clamp(14px, 2.5vw, 16px);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Summary Bar */
.pd-capacity-summary-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.pd-summary-item {
    text-align: center;
    padding: 20px 35px;
    background: #ffffff;
    border: 1px solid rgba(175, 196, 162, 0.2);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(22, 78, 61, 0.02);
    transition: all 0.3s ease;
    min-width: 140px;
}

.pd-summary-item:hover {
    transform: translateY(-2px);
    border-color: #AFC4A2;
    box-shadow: 0 15px 30px rgba(22, 78, 61, 0.04);
}

.pd-summary-number {
    font-size: 38px;
    font-weight: 800;
    color: #164E3D;
    display: block;
    line-height: 1.1;
    font-family: 'Cairo', 'Open Sans', sans-serif;
}

.pd-summary-number.pd-green { color: #22c55e; }
.pd-summary-number.pd-red { color: #ef4444; }
.pd-summary-number.pd-yellow { color: #f59e0b; }

.pd-summary-label {
    font-size: 13px;
    color: #5A5A5A;
    margin-top: 8px;
    display: block;
    font-weight: 600;
}

/* Department Cards Grid */
.pd-capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
}

.pd-capacity-card {
    background: #ffffff;
    border: 1px solid rgba(175, 196, 162, 0.22);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(22, 78, 61, 0.02);
}

.pd-capacity-card:hover {
    transform: translateY(-6px);
    border-color: #AFC4A2;
    box-shadow: 0 20px 40px rgba(22, 78, 61, 0.08);
}

.pd-capacity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.pd-capacity-card-icon {
    width: 52px;
    height: 52px;
    background: rgba(175, 196, 162, 0.12);
    color: #164E3D;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pd-capacity-card:hover .pd-capacity-card-icon {
    background: #164E3D;
    color: #ffffff;
}

.pd-capacity-card-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(175, 196, 162, 0.3);
}

.pd-capacity-card-badge.pd-incubator {
    background: #F4F7F2;
    color: #164E3D;
}

.pd-capacity-card-badge.pd-bed {
    background: #eef3ec;
    color: #164E3D;
}

.pd-capacity-card-name {
    color: #164E3D;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
}

/* Stats Row */
.pd-capacity-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #fcfbfa;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(175, 196, 162, 0.1);
}

.pd-capacity-stat {
    text-align: center;
    flex: 1;
}

.pd-capacity-stat:not(:last-child) {
    border-left: 1px solid rgba(175, 196, 162, 0.15);
}

.pd-capacity-stat-value {
    font-size: 26px;
    font-weight: 800;
    display: block;
    line-height: 1.1;
    font-family: 'Cairo', 'Open Sans', sans-serif;
}

.pd-capacity-stat-value.pd-available { color: #22c55e; }
.pd-capacity-stat-value.pd-occupied { color: #ef4444; }
.pd-capacity-stat-value.pd-total-val { color: #1e293b; }

.pd-capacity-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

/* Progress Bar */
.pd-capacity-progress {
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.pd-capacity-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.pd-capacity-progress-fill.pd-high {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.pd-capacity-progress-fill.pd-critical {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Card CTA */
.pd-capacity-card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #164E3D;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    width: 100%;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.pd-capacity-card-cta:hover {
    background: #AFC4A2;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(175, 196, 162, 0.3);
}

/* ═══════════════════════════════════════════════════════
   DEPARTMENT PAGE STATISTICS
   ═══════════════════════════════════════════════════════ */

.pd-dept-stats-panel {
    background: linear-gradient(135deg, #FEF9F3 0%, #FFFFFF 100%);
    border: 1px solid rgba(175, 196, 162, 0.25);
    border-radius: 24px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(22, 78, 61, 0.02);
}

.pd-dept-stats-title {
    font-size: 22px;
    font-weight: 700;
    color: #164E3D;
    margin: 0 0 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
}

.pd-dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.pd-dept-stat-card {
    background: #ffffff;
    border: 1px solid rgba(175, 196, 162, 0.15);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(22, 78, 61, 0.01);
    transition: all 0.3s ease;
}

.pd-dept-stat-card:hover {
    transform: translateY(-4px);
    border-color: #AFC4A2;
    box-shadow: 0 10px 25px rgba(22, 78, 61, 0.05);
}

.pd-dept-stat-number {
    font-size: 34px;
    font-weight: 800;
    display: block;
    line-height: 1.1;
    margin-bottom: 8px;
    font-family: 'Cairo', 'Open Sans', sans-serif;
}

.pd-dept-stat-number.pd-stat-total { color: #164E3D; }
.pd-dept-stat-number.pd-stat-available { color: #22c55e; }
.pd-dept-stat-number.pd-stat-occupied { color: #ef4444; }
.pd-dept-stat-number.pd-stat-maintenance { color: #f59e0b; }

.pd-dept-stat-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* Visual Unit Grid */
.pd-unit-grid-title {
    font-size: 16px;
    font-weight: 700;
    color: #164E3D;
    margin: 0 0 18px;
    font-family: 'Cairo', sans-serif;
}

.pd-unit-visual-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.pd-unit-cell {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: default;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pd-unit-cell:hover {
    transform: scale(1.18);
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.pd-unit-cell.pd-unit-available { background: #22c55e; }
.pd-unit-cell.pd-unit-occupied { background: #ef4444; }
.pd-unit-cell.pd-unit-maintenance { background: #f59e0b; }
.pd-unit-cell.pd-unit-reserved { background: #3b82f6; }

.pd-unit-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.pd-unit-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.pd-unit-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   BED BOOKING FORM
   ═══════════════════════════════════════════════════════ */

.pd-bed-booking-wrapper {
    max-width: 700px;
    margin: 50px auto;
    padding: 0 20px;
}

.pd-bed-booking-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(22, 78, 61, 0.05);
    overflow: hidden;
    border: 1px solid rgba(175, 196, 162, 0.2);
}

.pd-bed-booking-header {
    background: linear-gradient(135deg, #164E3D 0%, #0F3D2E 100%);
    padding: 40px 30px;
    text-align: center;
    color: #ffffff;
}

.pd-bed-booking-header h2 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
}

.pd-bed-booking-header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.85;
}

/* Availability Badge */
.pd-availability-badge {
    display: none;
    margin: 25px 30px 0;
    padding: 14px 20px;
    border-radius: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    color: #166534;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s;
}

.pd-availability-badge.pd-low-avail {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.pd-availability-badge.pd-no-avail {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.pd-availability-badge.pd-visible {
    display: block;
}

/* Form Body */
.pd-bed-booking-body {
    padding: 35px;
}

.pd-bed-form-group {
    margin-bottom: 24px;
}

.pd-bed-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #164E3D;
    margin-bottom: 8px;
    font-family: 'Cairo', sans-serif;
}

.pd-bed-form-group label .pd-required {
    color: #ef4444;
}

.pd-bed-form-group input,
.pd-bed-form-group select,
.pd-bed-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.pd-bed-form-group input:focus,
.pd-bed-form-group select:focus,
.pd-bed-form-group textarea:focus {
    border-color: #AFC4A2;
    box-shadow: 0 0 0 4px rgba(175, 196, 162, 0.25);
    outline: none;
    background: #ffffff;
}

.pd-bed-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.pd-bed-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Section Titles */
.pd-bed-form-section {
    font-size: 17px;
    font-weight: 700;
    color: #164E3D;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8efe5;
    margin: 40px 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo', sans-serif;
}

.pd-bed-form-section:first-of-type {
    margin-top: 0;
}

/* Urgency Selector */
.pd-urgency-options {
    display: flex;
    gap: 15px;
}

.pd-urgency-option {
    flex: 1;
    text-align: center;
}

.pd-urgency-option input {
    display: none;
}

.pd-urgency-option label {
    display: block;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 700;
}

.pd-urgency-option input:checked + label {
    border-color: #164E3D;
    background: #f0fdf4;
    color: #164E3D;
}

.pd-urgency-option.pd-urgency-urgent input:checked + label {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.pd-urgency-option.pd-urgency-critical input:checked + label {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

/* Submit Button */
.pd-bed-submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #164E3D 0%, #0F3D2E 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.4s;
    margin-top: 15px;
}

.pd-bed-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(22, 78, 61, 0.25);
    background: linear-gradient(135deg, #0F3D2E 0%, #164E3D 100%);
}

.pd-bed-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Privacy Check */
.pd-bed-privacy {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 25px 0 15px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    line-height: 1.5;
}

.pd-bed-privacy input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #164E3D;
    flex-shrink: 0;
}

/* Success Message */
.pd-bed-success {
    text-align: center;
    padding: 60px 40px;
}

.pd-bed-success-icon {
    font-size: 70px;
    margin-bottom: 24px;
    display: block;
}

.pd-bed-success h3 {
    color: #164E3D;
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 12px;
    font-family: 'Cairo', sans-serif;
}

.pd-bed-success p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

/* Counter Animation */
.pd-counter {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════ */

@media (max-width: 991px) {
    .pd-capacity-section { padding: 60px 0; }
    .pd-capacity-title { font-size: 28px; }
    .pd-capacity-grid { grid-template-columns: 1fr; gap: 20px; }
    .pd-capacity-summary-bar { gap: 15px; }
    .pd-summary-item { padding: 15px 25px; min-width: 120px; }
    .pd-summary-number { font-size: 32px; }
    .pd-dept-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media (max-width: 600px) {
    .pd-capacity-summary-bar {
        gap: 10px;
    }
    .pd-summary-item {
        padding: 12px 18px;
        flex: 1 1 40%;
    }
    .pd-summary-number { font-size: 28px; }
    .pd-capacity-card { padding: 25px; }
    .pd-capacity-stat-value { font-size: 22px; }
    .pd-dept-stats-panel { padding: 25px; }
    .pd-dept-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .pd-dept-stat-number { font-size: 28px; }
    .pd-unit-cell { width: 34px; height: 34px; font-size: 11px; }
    .pd-bed-form-row { grid-template-columns: 1fr; gap: 15px; }
    .pd-bed-booking-body { padding: 25px; }
    .pd-urgency-options { flex-direction: column; gap: 10px; }
}
