/*
 * Universal Modal System for TheSide Template
 * Lightweight, responsive, works anywhere
 */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 42, 46, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.show {
    display: flex !important;
}

/* Modal Container */
.modal {
    background: #35353A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

/* Modal Sizes */
.modal-sm { max-width: 300px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }
.modal-fullscreen {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
}

/* Modal Header */
.modal-header {
    padding: 30px 30px 0;
    border-bottom: 1px solid #444;
    position: relative;
}

.modal-title {
    font-family: 'BPG Arial Caps';
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-right: 40px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 25px 30px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-family: 'Mukta', sans-serif;
}

.modal-body h1, .modal-body h2, .modal-body h3,
.modal-body h4, .modal-body h5, .modal-body h6 {
    color: #fff;
    font-family: 'BPG Arial Caps';
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 15px 0;
}
.modal-body {
    font-family: 'BPG Arial';
}


/* Modal Footer */
.modal-footer {
    padding: 20px 30px 30px;
    border-top: 1px solid #444;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Buttons */
.btn-modal {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-family: 'BPG Arial Caps';
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-modal:hover {
    background: #805E43;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-primary {
    background: #ff6b35;
    border-color: #ff6b35;
}

.btn-primary:hover {
    background: #805E43;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Mukta', sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 12px 15px;
    font-size: 14px;
    font-family: 'Mukta', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.form-control:focus {
    outline: none;
    border-color: #ff6b35;
    background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 200px;
}

.form-col-full {
    flex: 100%;
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    font-family: 'Mukta', sans-serif;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* Loading State */
.modal.loading {
    pointer-events: none;
}

.modal.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
    }

    .modal {
        max-width: 100%;
        max-height: calc(100vh - 30px);
    }

    .modal-header {
        padding: 20px 20px 15px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 15px 20px 20px;
        flex-direction: column-reverse;
    }

    .modal-title {
        font-size: 20px;
        padding-right: 40px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-col {
        flex: none;
        min-width: auto;
        margin-bottom: 15px;
    }

    .btn-modal {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .btn-modal:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal {
        max-height: calc(100vh - 20px);
    }

    .modal-header {
        padding: 15px 15px 10px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        padding: 10px 15px 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 18px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Utility Classes */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }