:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

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

/* Header */
.header {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header-content {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

/* Logo Container */
.logo-container {
    flex-shrink: 0;
}

.hospital-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

/* Header Text */
.header-text {
    text-align: right;
    flex: 1;
}

/* User Info & Logout */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
}

.btn-logout {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.btn-logout:active {
    transform: translateY(0);
}

.header-text h1 {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hospital-name {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.department-name {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
}

.header-content i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.header-content h1 {
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 700;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-tab {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab i {
    font-size: 18px;
}

.nav-tab:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Page Content */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Card */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    font-size: 26px;
}

/* Form */
.complaint-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 18px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-dark);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    padding: 10px 20px;
    font-size: 14px;
}

.btn-success:hover {
    background: #059669;
}

/* WhatsApp Button Specific Styles */
.btn-success[style*="background: #25D366"],
.btn-success[onclick*="WhatsApp"] {
    background: #25D366 !important;
    position: relative;
    overflow: hidden;
}

.btn-success[style*="background: #25D366"]:hover,
.btn-success[onclick*="WhatsApp"]:hover {
    background: #128C7E !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.btn-success[style*="background: #25D366"]:active,
.btn-success[onclick*="WhatsApp"]:active {
    transform: translateY(0);
}

.btn-success .fa-whatsapp {
    font-size: 18px;
    animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
    padding: 10px 20px;
    font-size: 14px;
}

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

/* Export Button */
.btn-export {
    background: #16a34a;
    color: var(--white);
    padding: 10px 20px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-export:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 163, 74, 0.3);
}

.btn-export i {
    font-size: 16px;
}

/* Filter Options */
.filter-options {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
}

.filter-select option {
    background: var(--white);
    color: var(--text-dark);
}

/* Search Box */
.search-box {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box i {
    color: var(--text-light);
    font-size: 18px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Complaints Container */
.complaints-container {
    padding: 30px;
    min-height: 400px;
}

.complaint-item {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.complaint-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.complaint-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.complaint-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.complaint-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.status-investigating {
    background: #fef3c7;
    color: #92400e;
}

.status-responded {
    background: #d1fae5;
    color: #065f46;
}

.status-closed {
    background: #e5e7eb;
    color: #374151;
}

.complaint-details {
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
}

.detail-row i {
    color: var(--primary-color);
    width: 20px;
}

.detail-row strong {
    color: var(--text-dark);
    min-width: 100px;
}

.detail-row span {
    color: var(--text-light);
}

.complaint-text {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-right: 4px solid var(--primary-color);
}

.complaint-text p {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 14px;
}

.response-section {
    background: #ecfdf5;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid var(--success-color);
    margin-bottom: 15px;
}

.response-section h4 {
    color: var(--success-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-section p {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 14px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.modal-body {
    padding: 25px;
}

.complaint-info {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.complaint-info .detail-row {
    margin-bottom: 12px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Success Modal */
.success-modal {
    max-width: 450px;
    text-align: center;
    padding: 40px 30px;
}

.success-icon {
    margin-bottom: 20px;
}

.success-icon i {
    font-size: 72px;
    color: var(--success-color);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-modal h3 {
    color: var(--text-dark);
    font-size: 24px;
    margin-bottom: 15px;
}

.success-modal p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Pagination */
.pagination {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.page-btn {
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    background: var(--white);
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .header-text {
        text-align: center;
    }

    .header-text h1 {
        font-size: 22px;
    }

    .hospital-name {
        font-size: 16px;
    }

    .department-name {
        font-size: 14px;
    }

    .hospital-logo {
        height: 60px;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .nav-tab {
        width: 100%;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .complaint-form,
    .complaints-container,
    .modal-body {
        padding: 20px;
    }

    .complaint-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .complaint-actions {
        width: 100%;
    }

    .complaint-actions .btn {
        flex: 1;
        min-width: 120px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: var(--white);
    }

    .header,
    .nav-tabs,
    .complaint-actions,
    .search-box,
    .filter-options {
        display: none;
    }

    .card {
        box-shadow: none;
    }
}
