/**
 * Long-Term Care Services Styles
 * خدمات الرعاية المديدة
 *
 * @package Smart_Hospital_Enhanced
 */

/* ========================================
   LTC Services Page Layout
======================================== */
.ltc-services-page {
    padding-bottom: 30px;
    background: var(--bg-color, #f8f9fa);
    min-height: 100vh;
}

/* ========================================
   Header Section
======================================== */
.ltc-header {
    background: linear-gradient(135deg, var(--primary, #0077b6) 0%, #023e8a 100%);
    padding: 30px 20px;
    border-radius: 0 0 30px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.ltc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.ltc-header-content {
    position: relative;
    z-index: 1;
}

.ltc-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ltc-title .dashicons {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

.ltc-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin: 0;
}

.ltc-header-badge {
    position: relative;
    z-index: 1;
}

.aco-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   Quick Stats Section
======================================== */
.ltc-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .ltc-quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg, 16px);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,0.12));
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .dashicons {
    color: white;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark, #1a1a2e);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray, #6c757d);
}

/* ========================================
   ACO Benefits Banner
======================================== */
.aco-benefits-banner {
    margin: 0 20px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-lg, 16px);
    padding: 24px;
    color: white;
}

.aco-benefits-content h2 {
    font-size: 1.2rem;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.benefit-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.benefit-icon {
    font-size: 1.8rem;
}

.benefit-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================================
   Services Section
======================================== */
.ltc-services-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark, #1a1a2e);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .dashicons {
    color: var(--primary, #0077b6);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Service Card
======================================== */
.service-card {
    background: white;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-header {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.service-icon.dashicons {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-body {
    padding: 20px;
}

.service-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark, #1a1a2e);
    margin: 0 0 8px 0;
}

.service-description {
    color: var(--gray, #6c757d);
    font-size: 0.9rem;
    margin: 0 0 16px 0;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--dark, #1a1a2e);
    font-size: 0.9rem;
}

.service-features li .dashicons {
    color: var(--secondary, #28a745);
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.service-actions {
    display: flex;
    gap: 10px;
}

.service-actions .btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary, #0077b6);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark, #005f92);
}

.btn-secondary {
    background: var(--light, #f1f5f9);
    color: var(--dark, #1a1a2e);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ========================================
   Quick Actions Section
======================================== */
.ltc-quick-actions {
    padding: 0 20px;
    margin-bottom: 24px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quick-action-card {
    background: white;
    border-radius: var(--radius, 12px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
    transition: all 0.2s ease;
    position: relative;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,0.12));
    background: var(--primary, #0077b6);
}

.quick-action-card:hover .qa-icon,
.quick-action-card:hover .qa-text {
    color: white;
}

.qa-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--primary, #0077b6);
    transition: color 0.2s ease;
}

.qa-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark, #1a1a2e);
    transition: color 0.2s ease;
}

.qa-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger, #dc3545);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.qa-badge-warning {
    background: #f39c12;
}

/* ========================================
   Recent Activity Section
======================================== */
.ltc-recent-activity {
    padding: 0 20px;
}

.activity-list {
    background: white;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--light, #f1f5f9);
    transition: background 0.2s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--light, #f8f9fa);
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon .dashicons {
    color: white;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark, #1a1a2e);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.85rem;
    color: var(--gray, #6c757d);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.activity-separator {
    color: var(--gray-light, #adb5bd);
}

.activity-link {
    width: 36px;
    height: 36px;
    background: var(--light, #f1f5f9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray, #6c757d);
    transition: all 0.2s ease;
}

.activity-link:hover {
    background: var(--primary, #0077b6);
    color: white;
}

.activity-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--gray, #6c757d);
}

.activity-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ========================================
   Modal Styles
======================================== */
.ltc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.ltc-modal-content {
    background: white;
    border-radius: var(--radius-lg, 16px);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.ltc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light, #f1f5f9);
    background: var(--primary, #0077b6);
    color: white;
}

.ltc-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ltc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ltc-modal-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark, #1a1a2e);
    margin: 16px 0 12px;
}

.ltc-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ltc-modal-body ul li {
    padding: 8px 0;
    padding-right: 24px;
    position: relative;
    color: var(--dark, #1a1a2e);
}

.ltc-modal-body ul li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--secondary, #28a745);
    font-weight: bold;
}

.ltc-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--light, #f1f5f9);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ltc-modal-footer .btn {
    padding: 12px 24px;
}

/* ========================================
   Form Styles
======================================== */
.ltc-form .form-group {
    margin-bottom: 20px;
}

.ltc-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark, #1a1a2e);
    margin-bottom: 8px;
}

.ltc-form select,
.ltc-form input,
.ltc-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light, #e2e8f0);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--dark, #1a1a2e);
    transition: border-color 0.2s ease;
    background: white;
}

.ltc-form select:focus,
.ltc-form input:focus,
.ltc-form textarea:focus {
    outline: none;
    border-color: var(--primary, #0077b6);
}

.ltc-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RTL Support
======================================== */
[dir="rtl"] .activity-link .dashicons {
    transform: rotate(180deg);
}

[dir="rtl"] .ltc-modal-body ul li {
    padding-right: 0;
    padding-left: 24px;
}

[dir="rtl"] .ltc-modal-body ul li::before {
    right: auto;
    left: 0;
}

/* ========================================
   Patient Services Widget
======================================== */
.patient-ltc-services {
    background: white;
    border-radius: var(--radius-lg, 16px);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.patient-ltc-services h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark, #1a1a2e);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.patient-service-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--light, #f1f5f9);
}

.patient-service-tab {
    padding: 8px 16px;
    background: var(--light, #f1f5f9);
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray, #6c757d);
    cursor: pointer;
    transition: all 0.2s ease;
}

.patient-service-tab:hover,
.patient-service-tab.active {
    background: var(--primary, #0077b6);
    color: white;
}

.patient-service-content {
    min-height: 150px;
}

.service-record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light, #f8f9fa);
    border-radius: 10px;
    margin-bottom: 10px;
}

.service-record-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #0077b6);
    color: white;
}

.service-record-info {
    flex: 1;
}

.service-record-title {
    font-weight: 600;
    color: var(--dark, #1a1a2e);
    font-size: 0.95rem;
}

.service-record-meta {
    font-size: 0.85rem;
    color: var(--gray, #6c757d);
}

/* ========================================
   Status Badges
======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: #cce5ff;
    color: #004085;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-urgent {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   Priority Indicators
======================================== */
.priority-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
}

.priority-low { background: #28a745; }
.priority-medium { background: #ffc107; }
.priority-high { background: #fd7e14; }
.priority-urgent { background: #dc3545; animation: pulse-priority 1s infinite; }

@keyframes pulse-priority {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 480px) {
    .ltc-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .ltc-title {
        font-size: 1.5rem;
        justify-content: center;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .ltc-modal-content {
        max-height: 85vh;
    }
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .ltc-services-page {
        background: white;
    }
    
    .ltc-header {
        background: var(--primary, #0077b6) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .service-card,
    .quick-action-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn,
    .ltc-modal {
        display: none !important;
    }
}
