/**
 * Session Management UI Styles
 * Professional styling for session warnings and notifications
 */

/* Session Warning Modal */
.session-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.session-warning-modal.show {
    opacity: 1;
    visibility: visible;
}

.session-warning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.session-warning-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.session-warning-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 20px 24px;
    border-bottom: none;
}

.session-warning-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.session-warning-header h4:before {
    content: '⏰';
    margin-right: 10px;
    font-size: 1.2em;
}

.session-warning-body {
    padding: 24px;
    text-align: center;
}

.session-warning-body p {
    margin: 0 0 20px 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
}

.session-warning-countdown {
    background: linear-gradient(135deg, #ff6b6b10 0%, #ee5a5215 100%);
    border: 2px solid #ff6b6b20;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ff6b6b;
}

.session-warning-countdown span {
    font-size: 1.3em;
    font-weight: 700;
}

.session-warning-footer {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.session-warning-footer .btn {
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-warning-footer .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.session-warning-footer .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.session-warning-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.session-warning-footer .btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Session Toast Notifications */
.session-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

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

.session-toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 8px;
}

.session-toast-message {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.session-toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.7;
    cursor: pointer;
    margin-left: 15px;
    transition: opacity 0.2s ease;
}

.session-toast-close:hover {
    opacity: 1;
}

/* Toast variants */
.session-toast-success .session-toast-content {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.session-toast-error .session-toast-content {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.session-toast-warning .session-toast-content {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.session-toast-info .session-toast-content {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: white;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .session-warning-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .session-warning-body p {
        color: #e2e8f0;
    }
    
    .session-warning-footer {
        background: #1a202c;
        border-top-color: #4a5568;
    }
    
    .session-warning-countdown {
        background: linear-gradient(135deg, #ff6b6b15 0%, #ee5a5220 100%);
        border-color: #ff6b6b30;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .session-warning-content {
        width: 95%;
        margin: 20px;
    }
    
    .session-warning-footer {
        flex-direction: column;
    }
    
    .session-warning-footer .btn {
        width: 100%;
        margin: 4px 0;
    }
    
    .session-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
}

/* Navigation indicator removed - session management works seamlessly in background */

/* Session Success Modal Styling */
.session-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.session-success-modal.show {
    opacity: 1;
    visibility: visible;
}

.session-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.session-success-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.session-success-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.session-success-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: successPulse 0.6s ease-out;
}

.session-success-header h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

@keyframes successPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.session-success-body {
    padding: 25px;
    text-align: center;
    color: #212529;
    background: #ffffff;
}

.session-success-body p {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
}

.session-success-details {
    font-size: 1rem !important;
    color: #495057 !important;
    font-weight: 500 !important;
}

.session-success-footer {
    padding: 20px 25px 25px 25px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.session-success-footer .btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.session-success-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* Responsive Design */
@media (max-width: 576px) {
    .session-success-content {
        width: 95%;
        margin: 20px;
    }
    
    .session-success-header {
        padding: 20px;
    }
    
    .session-success-icon {
        font-size: 2.5rem;
    }
    
    .session-success-header h4 {
        font-size: 1.3rem;
    }
    
    .session-success-body {
        padding: 20px;
    }
}

/* Animation for countdown updates */
.session-warning-countdown span {
    transition: all 0.3s ease;
}

.session-warning-countdown span.updating {
    transform: scale(1.1);
    color: #ff4757;
}

/* Loading state for extend button */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff60;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}