.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.7) translateY(50px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

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

.modal-content {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

.modal-footer {
    padding: 20px 30px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-sm {
    width: 400px;
    max-width: 90vw;
}

.modal-md {
    width: 600px;
    max-width: 90vw;
}

.modal-lg {
    width: 900px;
    max-width: 95vw;
}

.modal-xl {
    width: 1200px;
    max-width: 95vw;
}

.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
}

.modal-fullscreen .modal-content {
    max-height: calc(100vh - 140px);
}

.modal-confirm .modal-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    text-align: center;
    padding-bottom: 20px;
}

.modal-confirm .modal-content {
    text-align: center;
    padding: 40px 30px;
}

.modal-confirm .modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.modal-success .modal-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.modal-success .modal-icon {
    color: #27ae60;
}

.modal-error .modal-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.modal-error .modal-icon {
    color: #e74c3c;
}

.modal-warning .modal-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.modal-warning .modal-icon {
    color: #f39c12;
}

.modal-info .modal-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.modal-info .modal-icon {
    color: #3498db;
}

.modal-dark {
    background: #2c3e50;
    color: white;
}

.modal-dark .modal-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-bottom-color: #34495e;
}

.modal-dark .modal-footer {
    border-top-color: #34495e;
}

.modal-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-glass .modal-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-glass .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-slide-top .modal {
    transform: translateY(-100px);
}

.modal-overlay.active .modal-slide-top .modal {
    transform: translateY(0);
}

.modal-slide-bottom .modal {
    transform: translateY(100px);
}

.modal-overlay.active .modal-slide-bottom .modal {
    transform: translateY(0);
}

.modal-slide-left .modal {
    transform: translateX(-100px);
}

.modal-overlay.active .modal-slide-left .modal {
    transform: translateX(0);
}

.modal-slide-right .modal {
    transform: translateX(100px);
}

.modal-overlay.active .modal-slide-right .modal {
    transform: translateX(0);
}

.modal-zoom .modal {
    transform: scale(0.3);
}

.modal-overlay.active .modal-zoom .modal {
    transform: scale(1);
}

.modal-rotate .modal {
    transform: scale(0.7) rotate(180deg);
}

.modal-overlay.active .modal-rotate .modal {
    transform: scale(1) rotate(0deg);
}

.modal-flip .modal {
    transform: perspective(1000px) rotateY(90deg);
}

.modal-overlay.active .modal-flip .modal {
    transform: perspective(1000px) rotateY(0deg);
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.modal-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.modal-btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.modal-btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.modal-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

.modal-btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.modal-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.3);
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.modal-form-group input,
.modal-form-group textarea,
.modal-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.modal-loading {
    position: relative;
}

.modal-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
    }
    
    .modal {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px 20px 15px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 20px;
        max-height: calc(95vh - 120px);
    }
    
    .modal-footer {
        padding: 15px 20px 20px;
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-sm,
    .modal-md,
    .modal-lg,
    .modal-xl {
        width: 95vw;
    }
    
    .modal-fullscreen {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-close {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
}

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

.modal-text-left {
    text-align: left;
}

.modal-text-right {
    text-align: right;
}

.modal-no-padding {
    padding: 0;
}

.modal-no-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-no-footer {
    border-top: none;
    padding-top: 0;
}

.modal-scrollable {
    overflow-y: auto;
}

.modal-fixed-height {
    height: 500px;
}

.modal-hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-hide-scrollbar::-webkit-scrollbar {
    display: none;
}
