/* Buckydrop Modal & Toast System */

/* Modal Overlay */
.bd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.bd-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Container */
.bd-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.4s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.bd-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bd-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.bd-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.bd-modal-close:hover {
    color: #333;
}

/* Modal Body */
.bd-modal-body {
    padding: 24px;
    min-height: 100px;
}

.bd-modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

.bd-modal-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.bd-modal-icon svg {
    width: 64px;
    height: 64px;
}

/* Modal Footer */
.bd-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal Buttons */
.bd-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.bd-modal-btn-primary {
    background: #e4002b;
    color: white;
}

.bd-modal-btn-primary:hover {
    background: #c50026;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3);
}

.bd-modal-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.bd-modal-btn-secondary:hover {
    background: #e0e0e0;
}

.bd-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Success State */
.bd-modal.success .bd-modal-header {
    background: #f0f8f5;
    border-bottom-color: #28a745;
}

.bd-modal.success .bd-modal-title {
    color: #28a745;
}

.bd-modal.success .bd-modal-icon svg {
    color: #28a745;
}

/* Error/Warning State */
.bd-modal.error .bd-modal-header {
    background: #fff5f5;
    border-bottom-color: #e74c3c;
}

.bd-modal.error .bd-modal-title {
    color: #e74c3c;
}

.bd-modal.error .bd-modal-icon svg {
    color: #e74c3c;
}

/* Loading State */
.bd-modal.loading .bd-modal-header {
    background: #f9f9f9;
}

.bd-modal.loading .bd-modal-close {
    display: none;
}

.bd-modal.loading .bd-modal-footer {
    display: none;
}

.bd-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.bd-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #e4002b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.bd-spinner-text {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Toast Notification */
.bd-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10001;
    max-width: 400px;
}

.bd-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.bd-toast.success {
    border-left: 4px solid #28a745;
}

.bd-toast.error {
    border-left: 4px solid #e74c3c;
}

.bd-toast.info {
    border-left: 4px solid #3498db;
}

.bd-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.bd-toast-icon svg {
    width: 100%;
    height: 100%;
}

.bd-toast.success .bd-toast-icon svg {
    color: #28a745;
}

.bd-toast.error .bd-toast-icon svg {
    color: #e74c3c;
}

.bd-toast.info .bd-toast-icon svg {
    color: #3498db;
}

.bd-toast-content {
    flex: 1;
}

.bd-toast-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.bd-toast.success .bd-toast-title {
    color: #28a745;
}

.bd-toast.error .bd-toast-title {
    color: #e74c3c;
}

.bd-toast.info .bd-toast-title {
    color: #3498db;
}

.bd-toast-message {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.bd-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bd-toast-close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .bd-modal {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .bd-toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .bd-modal-header,
    .bd-modal-body,
    .bd-modal-footer {
        padding: 16px;
    }

    .bd-modal-title {
        font-size: 18px;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .bd-modal-message {
        font-size: 14px;
    }

    .bd-modal-footer {
        flex-direction: column-reverse;
    }

    .bd-modal-btn {
        width: 100%;
    }

    .bd-toast {
        padding: 14px;
    }

    .bd-toast-title {
        font-size: 13px;
    }

    .bd-toast-message {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .bd-modal {
        width: calc(100% - 20px);
    }

    .bd-modal-header,
    .bd-modal-body,
    .bd-modal-footer {
        padding: 12px;
    }

    .bd-modal-title {
        font-size: 16px;
    }

    .bd-modal-icon svg {
        width: 48px;
        height: 48px;
    }

    .bd-loading-spinner {
        padding: 30px;
    }

    .bd-spinner {
        width: 40px;
        height: 40px;
    }
}

/* Prevent text overflow in modals */
.bd-modal-title,
.bd-modal-message,
.bd-toast-title,
.bd-toast-message {
    overflow-wrap: break-word;
    word-wrap: break-word;
}