/* ============================================
   MODAL COMPONENT STYLES - TECH THEME
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

    .modal.fade {
        transition: opacity 0.15s linear;
    }

        .modal.fade:not(.show) {
            opacity: 0;
        }

    .modal.show {
        opacity: 1;
    }

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 600px;
    pointer-events: none;
}

.modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
}

    .modal-dialog-scrollable .modal-content {
        max-height: 100%;
        overflow: hidden;
    }

    .modal-dialog-scrollable .modal-body {
        overflow-y: auto;
    }

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: linear-gradient(180deg, #1A2238 0%, #0A1128 100%);
    background-clip: padding-box;
    border: 2px solid rgba(0, 102, 255, 0.3);
    border-radius: 20px;
    outline: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 102, 255, 0.2);
    overflow: hidden;
}

    .modal-content::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, #0066FF, #00D9FF, #0066FF, transparent);
        background-size: 200% 100%;
        animation: modalShine 3s linear infinite;
    }

@keyframes modalShine {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

    .modal-backdrop.fade {
        opacity: 0;
        transition: opacity 0.15s linear;
    }

    .modal-backdrop.show {
        opacity: 1;
    }

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.2);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background: rgba(0, 102, 255, 0.05);
}

.modal-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.5;
    background: linear-gradient(135deg, #FFFFFF 0%, #00D9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 2rem;
    color: #FFFFFF;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(0, 102, 255, 0.2);
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
    background: rgba(0, 102, 255, 0.05);
}

.btn-close {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

    .btn-close::before {
        content: "×";
        font-size: 2rem;
        line-height: 1;
        color: #FFFFFF;
        position: relative;
        z-index: 1;
    }

    .btn-close:hover {
        opacity: 1;
        background: rgba(255, 107, 107, 0.2);
        border-color: #FF6B6B;
        transform: rotate(90deg) scale(1.1);
    }

    .btn-close:active {
        transform: rotate(90deg) scale(0.95);
    }

/* Modal Size Variants */
.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1140px;
}

/* Form Styles in Modal */
.modal-body .form-label {
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.modal-body .form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.05);
    background-clip: padding-box;
    border: 2px solid rgba(0, 102, 255, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .modal-body .form-control:focus {
        color: #FFFFFF;
        background-color: rgba(255, 255, 255, 0.08);
        border-color: #0066FF;
        outline: 0;
        box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15), 0 0 20px rgba(0, 102, 255, 0.3);
    }

    .modal-body .form-control::placeholder {
        color: rgba(255, 255, 255, 0.4);
        opacity: 1;
    }

.modal-body select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230066FF' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 3rem;
}

    .modal-body select.form-control option {
        background-color: #0A1128;
        color: #FFFFFF;
        padding: 0.75rem;
    }

.modal-body textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Alert Styles in Modal */
.modal-body .alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    color: #00E676;
    background-color: rgba(0, 230, 118, 0.1);
    border-color: rgba(0, 230, 118, 0.3);
}

    .alert-success::before {
        content: "✓";
        font-size: 1.25rem;
        font-weight: bold;
    }

.alert-danger {
    color: #FF6B6B;
    background-color: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

    .alert-danger::before {
        content: "⚠";
        font-size: 1.25rem;
    }

/* Button Styles in Modal */
.modal-body .btn,
.modal-footer .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.modal-body .btn-primary,
.modal-footer .btn-primary {
    background: linear-gradient(135deg, #0066FF 0%, #00D9FF 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
}

    .modal-body .btn-primary::before,
    .modal-footer .btn-primary::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s ease, height 0.6s ease;
    }

    .modal-body .btn-primary:hover:not(:disabled)::before,
    .modal-footer .btn-primary:hover:not(:disabled)::before {
        width: 300px;
        height: 300px;
    }

    .modal-body .btn-primary:hover:not(:disabled),
    .modal-footer .btn-primary:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 6px 25px rgba(0, 102, 255, 0.5);
    }

    .modal-body .btn-primary:active:not(:disabled),
    .modal-footer .btn-primary:active:not(:disabled) {
        transform: translateY(-1px);
    }

    .modal-body .btn-primary:disabled,
    .modal-footer .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.modal-body .btn-secondary,
.modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

    .modal-body .btn-secondary:hover,
    .modal-footer .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: #0066FF;
        transform: translateY(-2px);
    }

/* Spinner for loading state */
.spinner-border {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: -0.125em;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Validation Messages */
.validation-message {
    color: #FF6B6B;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .validation-message::before {
        content: "⚠";
        font-size: 1rem;
    }

.text-danger {
    color: #FF6B6B !important;
}

.text-success {
    color: #00E676 !important;
}

/* Form Group Spacing */
.modal-body .form-group {
    margin-bottom: 1.5rem;
}

    .modal-body .form-group:last-child {
        margin-bottom: 0;
    }

/* Enhanced Input Focus Effects */
.modal-body .form-control:focus {
    animation: inputGlow 0.3s ease;
}

@keyframes inputGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15), 0 0 20px rgba(0, 102, 255, 0.3);
    }
}

/* Checkbox and Radio Styles */
.modal-body input[type="checkbox"],
.modal-body input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #0066FF;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .modal-dialog-scrollable {
        height: calc(100% - 2rem);
    }

    .modal-content {
        border-radius: 15px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-body .btn,
    .modal-footer .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.25rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body .form-control {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .modal-body .btn,
    .modal-footer .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .btn-close {
        width: 35px;
        height: 35px;
    }
}

/* Dark Mode Scrollbar for Modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 255, 0.5);
    border-radius: 10px;
}

    .modal-body::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 102, 255, 0.7);
    }
