﻿/* ==================== Modal System ==================== */
.atl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

    .atl-modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.atl-modal-container {
    background: var(--atl-white);
    border-radius: var(--atl-radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atl-modal-overlay.active .atl-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.atl-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--atl-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.atl-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.atl-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--atl-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .atl-modal-icon i {
        font-size: 1.5rem;
    }

    .atl-modal-icon.success {
        background: #d4edda;
        color: #28a745;
    }

    .atl-modal-icon.error {
        background: #f8d7da;
        color: #dc3545;
    }

    .atl-modal-icon.warning {
        background: #fff3cd;
        color: #ffc107;
    }

    .atl-modal-icon.info {
        background: var(--atl-primary-pale);
        color: var(--atl-primary);
    }

.atl-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--atl-gray-900);
    margin: 0;
    line-height: 1.3;
}

.atl-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--atl-gray-100);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .atl-modal-close:hover {
        background: var(--atl-gray-200);
        transform: rotate(90deg);
    }

    .atl-modal-close i {
        font-size: 1.25rem;
        color: var(--atl-gray-600);
    }

/* Modal Body */
.atl-modal-body {
    padding: 2rem;
}

.atl-modal-message {
    font-size: 0.95rem;
    color: var(--atl-gray-700);
    line-height: 1.6;
    margin: 0;
}

/* Modal Form Elements */
.atl-modal-form-group {
    margin-bottom: 1.25rem;
}

.atl-modal-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--atl-gray-700);
    margin-bottom: 0.5rem;
}

.atl-modal-input,
.atl-modal-textarea,
.atl-modal-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--atl-gray-300);
    border-radius: var(--atl-radius-md);
    font-size: 0.9375rem;
    color: var(--atl-gray-900);
    background: var(--atl-white);
    font-family: inherit;
    transition: all 0.2s;
}

    .atl-modal-input:focus,
    .atl-modal-textarea:focus,
    .atl-modal-select:focus {
        outline: none;
        border-color: var(--atl-primary);
        box-shadow: 0 0 0 3px var(--atl-primary-pale);
    }

.atl-modal-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Modal Footer */
.atl-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--atl-gray-200);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.atl-modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--atl-radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.atl-modal-btn-primary {
    background: var(--atl-primary);
    color: var(--atl-white);
}

    .atl-modal-btn-primary:hover {
        background: var(--atl-primary-light);
        transform: translateY(-1px);
        box-shadow: var(--atl-shadow-md);
    }

.atl-modal-btn-danger {
    background: #dc3545;
    color: var(--atl-white);
}

    .atl-modal-btn-danger:hover {
        background: #c82333;
        transform: translateY(-1px);
        box-shadow: var(--atl-shadow-md);
    }

.atl-modal-btn-success {
    background: #28a745;
    color: var(--atl-white);
}

    .atl-modal-btn-success:hover {
        background: #218838;
        transform: translateY(-1px);
        box-shadow: var(--atl-shadow-md);
    }

.atl-modal-btn-secondary {
    background: var(--atl-gray-200);
    color: var(--atl-gray-700);
}

    .atl-modal-btn-secondary:hover {
        background: var(--atl-gray-300);
    }

/* Modal Image/Video */
.atl-modal-media {
    width: 100%;
    border-radius: var(--atl-radius-md);
    margin-bottom: 1rem;
}

/* Large Modal */
.atl-modal-container.large {
    max-width: 800px;
}

/* ==================== Toast/Notification System ==================== */
.atl-toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    pointer-events: none;
}

.atl-toast {
    background: var(--atl-white);
    border-radius: var(--atl-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    pointer-events: all;
    transform: translateX(-120%);
    animation: atlToastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border-right: 4px solid;
}

    .atl-toast.removing {
        animation: atlToastSlideOut 0.3s ease forwards;
    }

@keyframes atlToastSlideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes atlToastSlideOut {
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/* Toast Icons */
.atl-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .atl-toast-icon i {
        font-size: 1.25rem;
    }

.atl-toast.success {
    border-right-color: #28a745;
}

    .atl-toast.success .atl-toast-icon {
        background: #d4edda;
        color: #28a745;
    }

.atl-toast.error {
    border-right-color: #dc3545;
}

    .atl-toast.error .atl-toast-icon {
        background: #f8d7da;
        color: #dc3545;
    }

.atl-toast.warning {
    border-right-color: #ffc107;
}

    .atl-toast.warning .atl-toast-icon {
        background: #fff3cd;
        color: #ffc107;
    }

.atl-toast.info {
    border-right-color: var(--atl-primary);
}

    .atl-toast.info .atl-toast-icon {
        background: var(--atl-primary-pale);
        color: var(--atl-primary);
    }

/* Toast Content */
.atl-toast-content {
    flex: 1;
}

.atl-toast-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--atl-gray-900);
    margin: 0 0 0.25rem;
}

.atl-toast-message {
    font-size: 0.875rem;
    color: var(--atl-gray-600);
    margin: 0;
    line-height: 1.4;
}

/* Toast Close */
.atl-toast-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .atl-toast-close:hover {
        background: var(--atl-gray-100);
        transform: rotate(90deg);
    }

    .atl-toast-close i {
        font-size: 1.125rem;
        color: var(--atl-gray-500);
    }

/* Progress Bar */
.atl-toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--atl-gray-300);
    border-radius: 0 0 var(--atl-radius-md) var(--atl-radius-md);
    overflow: hidden;
}

.atl-toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: atlToastProgress linear forwards;
}

@keyframes atlToastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .atl-modal-container {
        max-width: 100%;
        margin: 0;
        border-radius: var(--atl-radius-lg);
    }

    .atl-modal-header,
    .atl-modal-body,
    .atl-modal-footer {
        padding: 1.25rem 1.5rem;
    }

    .atl-modal-footer {
        flex-direction: column;
    }

    .atl-modal-btn {
        width: 100%;
        justify-content: center;
    }

    .atl-toast-container {
        left: 1rem;
        right: 1rem;
        max-width: calc(100% - 2rem);
    }
}
