/* Modal and Authentication Styles - FIXED VERSION */

/* Fix modal positioning - center in browser window viewport */
.modal.fade,
.modal.show {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: none !important; /* Remove backdrop */
    z-index: 1050 !important;
}

/* Fix modal dialog centering - center horizontally, fixed top position */
.modal-dialog-centered {
    position: fixed !important;
    top: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    padding: 1rem !important;
    width: auto !important;
    max-width: 500px !important;
    box-sizing: border-box !important;
}

/* Modal content styling */
.modal-content {
    position: relative !important;
    max-width: 500px !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3) !important;
    border-radius: 15px !important;
    overflow: hidden !important;
}

/* Prevent horizontal scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Auth flip animation */
.auth-flip-container {
    position: relative;
    width: 100%;
    height: 520px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.auth-flip-container.flipped {
    transform: rotateY(180deg);
}

.auth-form-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
}

.auth-register {
    transform: rotateY(180deg);
}

/* Form inputs */
.auth-input {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.auth-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Auth primary button */
.btn-auth-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-inverse);
    transition: all 0.3s ease;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    color: var(--text-inverse);
}

/* Flip buttons */
.flip-to-register, .flip-to-login {
    color: var(--primary-color) !important;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    background: none;
}

.flip-to-register:hover, .flip-to-login:hover {
    color: #764ba2 !important;
    transform: translateX(5px);
}

/* Modal styling */
#authModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

#authModal .modal-header {
    border-bottom: 1px solid var(--border-color);
}

#authModal .modal-title {
    color: var(--text-primary);
}

/* Statistics cards */
.stat-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px var(--shadow), 0 2px 4px -1px var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 20px 25px -5px var(--shadow-hover), 0 10px 10px -5px var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Feature icons */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.feature-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Hero section animations */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.08)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.06)"/><circle cx="70" cy="70" r="1.2" fill="rgba(255,255,255,0.05)"/></svg>');
    animation: floating-animation 20s ease-in-out infinite;
}

/* CTA section animations */
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: floating-animation 30s linear infinite;
}