/**
 * ConnecThrive - Modern UI Components CSS
 * Toast, Loading, Confirm Modal stilleri
 */

/* ==================== TOAST NOTIFICATIONS ==================== */
.connecthrive-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.connecthrive-toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 300px;
    max-width: 450px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.connecthrive-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.connecthrive-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connecthrive-toast .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.connecthrive-toast .toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #2c3e50;
}

.connecthrive-toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
}

/* Toast Types */
.connecthrive-toast-success {
    border-left: 4px solid #27ae60;
}

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

.connecthrive-toast-success .toast-progress {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.connecthrive-toast-error {
    border-left: 4px solid #e74c3c;
}

.connecthrive-toast-error .toast-icon {
    color: #e74c3c;
}

.connecthrive-toast-error .toast-progress {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.connecthrive-toast-warning {
    border-left: 4px solid #f39c12;
}

.connecthrive-toast-warning .toast-icon {
    color: #f39c12;
}

.connecthrive-toast-warning .toast-progress {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.connecthrive-toast-info {
    border-left: 4px solid #3498db;
}

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

.connecthrive-toast-info .toast-progress {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

/* Toast Progress Animation */
@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}


/* Smooth spin animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==================== COMPACT LOADING (Toast Style) ==================== */
.connecthrive-loading-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.connecthrive-loading-overlay.show {
    opacity: 1;
    transform: translateX(0);
}

.loading-spinner {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    border-left: 4px solid #E7921A;
    animation: loadingSlideIn 0.3s ease;
}

@keyframes loadingSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-spinner i {
    font-size: 24px;
    color: #E7921A;
    margin: 0;
    animation: spinSmooth 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spinSmooth {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.5;
}

/* Loading Dots Animation */
.loading-spinner p::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Alternative: Circular Progress */
.loading-spinner.circular {
    padding: 16px 24px;
}

.loading-spinner.circular i {
    position: relative;
    width: 24px;
    height: 24px;
    animation: none;
}

.loading-spinner.circular i::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #f0f0f0;
    border-top-color: #E7921A;
    border-radius: 50%;
    animation: circularSpin 0.8s linear infinite;
}

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

/* Pulse Effect */
.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, transparent, rgba(231, 146, 26, 0.1), transparent);
    animation: shimmerMove 2s linear infinite;
    pointer-events: none;
}

@keyframes shimmerMove {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .connecthrive-loading-overlay {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .loading-spinner {
        min-width: auto;
        width: 100%;
    }

    .loading-spinner p {
        font-size: 13px;
    }

    .loading-spinner i {
        font-size: 20px;
    }
}


/* Hover Effect - Optional */
.loading-spinner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.2);
}

/* Close Button - Optional */
.loading-spinner .loading-close {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.loading-spinner .loading-close:hover {
    color: #e74c3c;
}

/* Stacking - Multiple Loadings */
.connecthrive-loading-overlay:nth-of-type(2) {
    top: 90px;
}

.connecthrive-loading-overlay:nth-of-type(3) {
    top: 160px;
}

.connecthrive-loading-overlay:nth-of-type(4) {
    top: 230px;
}

/* Progress Bar Variant */
.loading-spinner.with-progress {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 12px;
}

.loading-progress-bar {
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E7921A, #d17d10);
    border-radius: 2px;
    animation: progressIndeterminate 1.5s ease-in-out infinite;
}

@keyframes progressIndeterminate {
    0% {
        transform: translateX(-100%);
        width: 30%;
    }
    50% {
        width: 50%;
    }
    100% {
        transform: translateX(300%);
        width: 30%;
    }
}

/* ==================== CONFIRM MODAL ==================== */
.connecthrive-confirm-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.connecthrive-confirm-modal .connecthrive-modal-content {
    background: white;
    margin: 15% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connecthrive-confirm-modal .confirm-header {
    background: linear-gradient(135deg, #E7921A 0%, #d17d10 100%);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.connecthrive-confirm-modal .confirm-header i {
    font-size: 28px;
}

.connecthrive-confirm-modal .confirm-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.connecthrive-confirm-modal .confirm-body {
    padding: 30px;
}

.connecthrive-confirm-modal .confirm-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #2c3e50;
}

.connecthrive-confirm-modal .confirm-actions {
    padding: 0 30px 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.connecthrive-confirm-modal .confirm-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connecthrive-confirm-modal .confirm-actions .btn-primary {
    background: linear-gradient(135deg, #E7921A 0%, #d17d10 100%);
    color: white;
}

.connecthrive-confirm-modal .confirm-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 146, 26, 0.4);
}

.connecthrive-confirm-modal .confirm-actions .btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.connecthrive-confirm-modal .confirm-actions .btn-secondary:hover {
    background: #bdc3c7;
    transform: translateY(-2px);
}

/* ==================== BUTTON LOADING STATES ==================== */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn .fa-spinner {
    margin-right: 8px;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .connecthrive-toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .connecthrive-toast {
        min-width: auto;
        max-width: 100%;
    }

    .connecthrive-loading-overlay {
        top: 10px;
        right: 10px;
    }


}