/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1% 0;
}

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

.modal-content {
    background-color: #ffffff;
    margin: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scroll */
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Modal Sizes */
.modal-content.modal-small {
    max-width: 800px;
}

.modal-content.modal-medium {
    max-width: 1000px;
}

.modal-content.modal-large {
    max-width: 1200px;
}

.modal-content.modal-fullscreen {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
}

/* Modal Types */
.modal-content.modal-info .modal-header {
    background-color: var(--accent-color-light, #e6f2ff);
    border-bottom: 2px solid #e0e0e0;
}

.modal-content.modal-info .modal-header h2 {
    color: var(--accent-color, #0066cc);
}

.modal-content.modal-warning .modal-header {
    background-color: #fff3e0;
    border-bottom-color: #ff9800;
}

.modal-content.modal-warning .modal-header h2 {
    color: #ff9800;
}

.modal-content.modal-error .modal-header {
    background-color: #ffebee;
    border-bottom-color: #f44336;
}

.modal-content.modal-error .modal-header h2 {
    color: #f44336;
}

.modal-content.modal-success .modal-header {
    background-color: #e6f7e6;
    border-bottom-color: #28a745;
}

.modal-content.modal-success .modal-header h2 {
    color: #28a745;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    padding-right: 4rem; /* Space for close button */
    border-bottom: 2px solid #e0e0e0;
    background-color: #f5f7fa;
    border-radius: 12px 12px 0 0;
    position: relative;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--accent-color-dark, #003366);
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666666;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--accent-color-dark, #003366);
    background-color: #e0e0e0;
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    color: var(--accent-color-dark, #003366);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.info-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f7fa;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #4d4d4d;
    min-width: 150px;
    flex-shrink: 0;
}

.info-value {
    color: #2c3e50;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: #f5f7fa;
    border-radius: 0 0 12px 12px;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background-color: var(--accent-color, #0066cc);
    color: #ffffff;
}

.modal-btn.primary:hover {
    background-color: var(--accent-color-dark, #0052a5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.modal-btn.secondary {
    background-color: #ffffff;
    color: var(--accent-color-dark, #003366);
    border: 2px solid var(--accent-color, #0066cc);
}

.modal-btn.secondary:hover {
    background-color: var(--accent-color-light, #e6f2ff);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.modal-btn.danger {
    background-color: #f44336;
    color: #ffffff;
}

.modal-btn.danger:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.modal-btn.success {
    background-color: #28a745;
    color: #ffffff;
}

.modal-btn.success:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Tablet Mode Styles */
body.tablet-mode .modal.show {
    padding: 1% 0;
    align-items: center;
    overflow: hidden;
}

body.tablet-mode .modal {
    overflow: hidden;
}

body.tablet-mode .modal-content {
    width: 94%;
    margin: 1% 3%;
    max-height: 92vh;
    height: auto;
    min-height: 0;
}

body.tablet-mode .modal-content.modal-small {
    width: 94%;
    max-width: none;
    margin: 1% 3%;
    max-height: 92vh;
    min-height: 0;
}

body.tablet-mode .modal-content.modal-medium {
    width: 94%;
    max-width: none;
    margin: 1% 3%;
    max-height: 92vh;
    min-height: 0;
}

body.tablet-mode .modal-content.modal-large {
    width: 94%;
    max-width: none;
    margin: 1% 3%;
    max-height: 95vh;
    min-height: 0;
}

body.tablet-mode .modal-content.modal-fullscreen {
    width: 94vw;
    height: 98vh;
    margin: 1vh 3vw;
}

body.tablet-mode .modal-header {
    padding: 1.5rem 2rem;
}

body.tablet-mode .modal-header h2 {
    font-size: 2rem;
}

body.tablet-mode .modal-close {
    display: none !important;
}

body.tablet-mode .modal-body {
    padding: 2.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Allow flex shrinking */
}

body.tablet-mode .modal-body:has(.info-section) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

body.tablet-mode .modal-body .info-section {
    margin-bottom: 0;
}

body.tablet-mode .modal-body:has(.contact-form) {
    display: block;
}

body.tablet-mode .info-section h3 {
    font-size: 2rem;
}

body.tablet-mode .info-row {
    padding: 1rem 0;
    font-size: 1.75rem;
}

body.tablet-mode .info-label {
    min-width: 200px;
    font-size: 1.75rem;
}

body.tablet-mode .info-value {
    font-size: 1.75rem;
}

body.tablet-mode .modal-footer {
    padding: 2rem 2.5rem;
}

body.tablet-mode .modal-btn {
    font-size: 1.75rem;
    padding: 1.5rem 2rem;
}

