/* Shared Error Pages Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #667eea 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    overflow: hidden;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.error-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
}

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

.error-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.error-number {
    font-size: 8rem;
    font-weight: 900;
    color: #667eea;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
}

.error-number::after {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 2s ease-in-out infinite;
}

@keyframes shimmerText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* Icon-specific animations */
.icon .fa-lock { animation: pulse 2s ease-in-out infinite; }
.icon .fa-user-slash { animation: lockShake 3s ease-in-out infinite; }
.icon .fa-exclamation-triangle { animation: bounce 2s ease-in-out infinite; }
.icon .fa-clock { animation: tick 3s ease-in-out infinite; }
.icon .fa-tools { animation: shake 3s ease-in-out infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: rotate(2deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes tick {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.message {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
}

.message p {
    margin-bottom: 1rem;
}

.highlight {
    color: #667eea;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

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

.btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.footer-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 0.9rem;
    color: #888;
}

.footer-info i {
    color: #667eea;
    margin-right: 0.5rem;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    font-size: 1.5rem;
    animation: floatAround 15s linear infinite;
}

.floating-element:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 20%;
    right: 10%;
    animation-delay: 5s;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: 10s;
}

.floating-element:nth-child(4) {
    bottom: 10%;
    right: 20%;
    animation-delay: 7.5s;
}

@keyframes floatAround {
    0% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-50px) translateX(30px) rotate(90deg); }
    50% { transform: translateY(-100px) translateX(0px) rotate(180deg); }
    75% { transform: translateY(-50px) translateX(-30px) rotate(270deg); }
    100% { transform: translateY(0px) translateX(0px) rotate(360deg); }
}

/* Additional Components */
.status-indicator, .session-info, .auth-info {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 1rem;
    margin: 1.5rem 0;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.status-text, .session-text, .auth-text {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 8px;
    margin-left: 8px;
}

.loading-dots span {
    position: absolute;
    top: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #667eea;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { left: 0; animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { left: 8px; animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { left: 16px; animation-delay: 0s; }

@keyframes loading {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.session-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.session-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #667eea;
}

.session-icon {
    color: #667eea;
    animation: shield-pulse 2s ease-in-out infinite;
}

@keyframes shield-pulse {
    0% { transform: scale(1); color: #667eea; }
    50% { transform: scale(1.1); color: #764ba2; }
    100% { transform: scale(1); color: #667eea; }
}

/* Auth info styles for 401 error page */
.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.auth-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #667eea;
}

.auth-icon {
    color: #667eea;
    animation: key-rotate 3s ease-in-out infinite;
}

@keyframes key-rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .error-card {
        padding: 2rem 1.5rem;
    }

    .error-number {
        font-size: 6rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .message {
        font-size: 1rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}
