/**
 * Visa Cases Module Styles - AL AWAN ERP System
 */

:root {
    --visa-primary: var(--primary-color, #0d47a1);
    --visa-primary-dark: var(--primary-dark, #0a3d91);
    --visa-primary-light: var(--primary-light, #1565c0);
    --visa-gradient: linear-gradient(135deg, var(--visa-primary-dark) 0%, var(--visa-primary) 100%);
}

/* ============================================================================
   Form Sections
   ============================================================================ */

.form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--visa-primary);
}

.form-section h3 {
    color: var(--visa-primary);
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--visa-primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
}

.form-group input[readonly] {
    background: #f0f0f0;
    cursor: not-allowed;
}

.select-add-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-add-group select {
    flex: 1;
}

.btn-add-mini {
    border: 1px solid var(--visa-primary);
    background: var(--visa-primary);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-add-mini:hover {
    background: var(--visa-primary-dark);
    border-color: var(--visa-primary-dark);
}

.required {
    color: #f44336;
    font-weight: bold;
}

/* ============================================================================
   Tables
   ============================================================================ */

.cases-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.cases-table thead {
    background: var(--visa-gradient);
    color: white;
}

.cases-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.cases-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.cases-table tbody tr:hover {
    background: #f9f9f9;
}

.cases-table tbody tr.no-data {
    text-align: center;
    color: #999;
}

.cases-table tbody tr.no-data td {
    padding: 30px;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 15px;
}

.invoices-table thead {
    background: #f5f5f5;
}

.invoices-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--visa-primary);
    font-size: 14px;
}

.invoices-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.invoices-table tbody tr:hover {
    background: #f9f9f9;
}

.invoices-table tbody tr.no-data {
    text-align: center;
    color: #999;
}

/* ============================================================================
   Badges & Statuses
   ============================================================================ */

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-visa {
    background: #2196F3;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.priority-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.priority-low {
    background: #4CAF50;
    color: white;
}

.priority-normal {
    background: #4CAF50;
    color: white;
}

.priority-medium {
    background: #FF9800;
    color: white;
}

.priority-mediam {
    background: #FF9800;
    color: white;
}

.priority-high {
    background: #F44336;
    color: white;
}

.priority-urgent {
    background: #9C27B0;
    color: white;
}

/* ============================================================================
   Case Details View
   ============================================================================ */

.case-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-card h4 {
    color: var(--visa-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--visa-primary);
    font-size: 14px;
    font-weight: 600;
}

.detail-card p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
}

.detail-card strong {
    color: #333;
    font-weight: 600;
}

.detail-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================================
   Status History
   ============================================================================ */

.status-update-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.status-update-section h3 {
    color: var(--visa-primary);
    margin-bottom: 15px;
}

.status-history {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--visa-primary);
}

.history-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.history-content h4 {
    color: var(--visa-primary);
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.history-date {
    color: #999;
    font-size: 12px;
    margin: 0 0 8px 0;
}

.history-comment {
    color: #555;
    font-size: 13px;
    margin: 0;
    font-style: italic;
}

/* ============================================================================
   Financial Summary
   ============================================================================ */

.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: var(--visa-gradient);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.summary-item span {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.summary-item strong {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.financial-quick {
    font-size: 12px;
    color: var(--visa-primary);
    font-weight: 600;
}

/* ============================================================================
   Attachments
   ============================================================================ */

.attachments-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.upload-area {
    margin-bottom: 20px;
}

.attachments-list {
    display: grid;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.attachment-item i {
    font-size: 24px;
    color: var(--visa-primary);
}

.attachment-info {
    flex: 1;
}

.attachment-info p {
    margin: 0;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.attachment-info small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn-action {
    background: transparent;
    border: none;
    color: var(--visa-primary);
    cursor: pointer;
    padding: 6px;
    margin: 0 2px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-action:hover {
    background: #f0f0f0;
    color: var(--visa-primary-dark);
}

.btn-action.btn-danger {
    color: #f44336;
}

.btn-action.btn-danger:hover {
    background: #ffebee;
    color: #d32f2f;
}

/* ============================================================================
   Invoices Section
   ============================================================================ */

.invoices-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

/* ============================================================================
   Tabs
   ============================================================================ */

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--visa-primary);
}

.tab-btn.active {
    color: var(--visa-primary);
    border-bottom-color: var(--visa-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1001;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    background: var(--visa-gradient);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* ============================================================================
   Control Panel
   ============================================================================ */

.control-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.search-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--visa-primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
}

/* ============================================================================
   Notification
   ============================================================================ */

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   Table Container
   ============================================================================ */

.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .case-details-grid {
        grid-template-columns: 1fr;
    }

    .search-section {
        grid-template-columns: 1fr;
    }

    .financial-summary {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 20px;
    }

    .modal-content {
        max-width: 90%;
        width: 100%;
    }

    .modal-large {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .control-panel {
        padding: 15px;
    }

    .panel-section {
        flex-direction: column;
    }

    .panel-section button {
        width: 100%;
    }

    .cases-table th,
    .cases-table td {
        padding: 10px;
        font-size: 13px;
    }

    .cases-table {
        font-size: 12px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 12px;
    }

    .modal {
        padding: 15px;
    }

    .modal-content {
        border-radius: 8px;
        max-width: 95%;
        width: 100%;
    }

    .modal-large {
        max-width: 90%;
    }

    .form-section {
        padding: 15px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 17px;
    }

    .modal-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-large {
        max-width: 100%;
    }

    .cases-table th,
    .cases-table td {
        padding: 8px;
        font-size: 11px;
    }

    .status-badge {
        padding: 4px 8px;
        font-size: 10px;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h2 {
        font-size: 15px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .modal-body {
        padding: 12px;
    }

    .form-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .form-row {
        gap: 12px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .btn-primary i,
    .btn-secondary i {
        font-size: 12px;
    }
}

/* ============================================================================
   Button Styles - New Visa Case & Export Buttons
   ============================================================================ */

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--visa-gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--visa-primary-dark);
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.35);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary-color) 100%);
    box-shadow: 0 6px 20px rgba(0, 137, 123, 0.35);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 137, 123, 0.2);
}

/* Icon styling in buttons */
.btn-primary i,
.btn-secondary i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-primary:hover i,
.btn-secondary:hover i {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary {
        padding: 10px 18px;
        font-size: 14px;
        gap: 8px;
    }

    .btn-primary i,
    .btn-secondary i {
        font-size: 14px;
    }
}
