/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Common container styles */
.loading-container,
.redirect-container,
.retry-container,
.manual-redirect-container,
.error-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f4 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: 2rem;
    text-align: center;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

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

.loading-text {
    color: #6b7280;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
}

/* Iframe container styles */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.cv-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #ffffff;
}

/* Error styles */
.error-icon {
    width: 80px;
    height: 80px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #dc2626;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.6;
}

.error-button {
    background: #2563eb;
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.error-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.8rem;
    }
    
    .error-title {
        font-size: 1.25rem;
    }
    
    .error-message {
        font-size: 0.9rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
    }
    
    .loading-container,
    .redirect-container,
    .retry-container,
    .manual-redirect-container,
    .error-container {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .error-button {
        border: 2px solid #000;
    }
}