/* Import component styles */
@import url('components/navbar.css');
@import url('components/footer.css');
@import url('components/home.css');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;700&family=Rajdhani:wght@300;400;500&display=swap');

/* Main Mystical Theme */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url("../images/nebula-wallpaper.jpg") !important;
    -webkit-transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow-x: hidden;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 35%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 65%, rgba(75, 0, 130, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 25%, rgba(186, 85, 211, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Desktop devices */
@media (min-width: 1024px) {
    body {
        background-attachment: fixed; /* Only use fixed on desktop */
    }
}

/* Page transition animations */
.fade-transition {
    animation: fadeTransition 0.5s ease-out;
}

@keyframes fadeTransition {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

h1, h2, h3, .mystical-title, .card-header {
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    text-align: center;
}

/* Stars Animation */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0% { opacity: 0; transform: translateY(0); }
    10% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Mystical Card Styling */
.mystical-card {
    background: rgba(10, 10, 30, 0.75);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5), 0 0 50px rgba(25, 25, 112, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 43, 226, 0.3);
    transition: all 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
}

.mystical-card:hover {
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.7), 0 0 50px rgba(25, 25, 112, 0.4);
}

.mystical-card .card-header {
    background: linear-gradient(to right, #1e0066, #6a0dad);
    color: white;
    border-bottom: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
    font-size: 1.3rem;
    text-align: center;
    text-transform: uppercase;
}

.mystical-card .card-body {
    padding: 25px;
}

.mystic-link {
    color: #bb86fc;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mystic-link:hover {
    color: #d8b5ff;
    text-shadow: 0 0 8px rgba(216, 181, 255, 0.5);
}

/* Form Controls */
.form-control {
    background-color: rgba(30, 30, 60, 0.4);
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: white;
    transition: all 0.3s ease;
    padding: 12px 15px;
    font-size: 1.1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
}

.form-control:focus {
    background-color: rgba(30, 30, 60, 0.6);
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    color: white;
}

.form-label {
    color: #d8b5ff;
    font-size: 1rem;
    margin-bottom: 10px;
    display: block;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.25rem;
}

.form-check-label {
    padding-left: 5px;
    color: #d8b5ff;
}

.btn-portal {
    background: linear-gradient(to right, #4b0082, #9400d3);
    border: none;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    padding: 12px 20px;
    border-radius: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(75, 0, 130, 0.3);
    width: 100%;
    font-weight: 500;
}

.btn-portal:hover {
    background: linear-gradient(to right, #9400d3, #4b0082);
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(75, 0, 130, 0.4);
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(to right, #4b0082, #9400d3);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(to right, #9400d3, #4b0082);
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* Floating elements animation */
.floating-element {
    opacity: 0.7;
    filter: blur(1px);
}

@keyframes float {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.2; }
    25% { transform: translateY(-20px) translateX(10px) rotate(90deg); opacity: 0.7; }
    50% { transform: translateY(-10px) translateX(20px) rotate(180deg); opacity: 0.5; }
    75% { transform: translateY(10px) translateX(-10px) rotate(270deg); opacity: 0.7; }
    100% { transform: translateY(0) translateX(0) rotate(360deg); opacity: 0.2; }
}

/* Text colors */
.text-purple-300 {
    color: #d8b5ff !important;
}

.text-purple-300:hover {
    color: #e7ceff !important;
    text-decoration: none;
}

/* Custom button focus state */
.btn:focus, .btn.focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(138, 43, 226, 0.25);
}

/* Custom input placeholder color */
::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Mystic glow effects */
.mystic-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.4) 0%, rgba(25, 25, 112, 0) 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(20px);
}

/* Purple line separator */
.purple-line {
    height: 2px;
    background: linear-gradient(to right, rgba(75, 0, 130, 0), rgba(148, 0, 211, 1), rgba(75, 0, 130, 0));
    margin: 30px 0;
}

/* Mystical alert styling */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.alert-success {
    background: rgba(0, 128, 0, 0.2);
    color: #a0ffa0;
    border-left: 4px solid #00c000;
}

.alert-danger {
    background: rgba(220, 20, 60, 0.2);
    color: #ffa0a0;
    border-left: 4px solid #dc143c;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: alert-shine 3s infinite;
}

@keyframes alert-shine {
    0% { transform: translateX(-100%); }
    20% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* Base responsive adjustments */
html, body {
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    
    /* Title adjustments */
    .mystical-title {
        font-size: 1.8rem;
        letter-spacing: 2px !important;
    }
    
    /* Card adjustments */
    .mystical-card {
        margin: 0 15px;
        padding: 5px;
    }
    
    .mystical-card .card-header {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .mystical-card .card-body {
        padding: 20px 15px;
    }
    
    /* Form adjustments */
    .form-control {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .btn-portal {
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    /* Reduce floating elements on mobile for performance */
    .floating-element:nth-child(n+6) {
        display: none;
    }
}

/* Small mobile adjustments */
@media (max-width: 360px) {
    .mystical-title {
        font-size: 1.5rem;
    }
    
    .mystical-card .card-header {
        font-size: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
    }
    
    .btn-portal {
        padding: 8px 12px;
    }
    
    /* Further reduce animations on very small devices */
    .floating-element:nth-child(n+4) {
        display: none;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    .col-md-6 {
        max-width: 80%;
        flex: 0 0 80%;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .mystical-title {
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .mb-5 {
        margin-bottom: 1rem !important;
    }
    
    .mt-5 {
        margin-top: 1rem !important;
    }
    
    .form-control {
        margin-bottom: 0.5rem;
    }
    
    .mystical-card .card-body {
        padding: 15px;
    }
}

/* Touch-friendly form elements */
@media (max-width: 767px) {
    input, select, textarea, button {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    .form-control {
        min-height: 44px; /* Apple's recommended touch target size */
    }
    
    .btn {
        min-height: 44px;
    }
    
    .form-check-input {
        width: 22px;
        height: 22px;
    }
    
    /* Increase spacing between elements */
    .form-check-label {
        padding-left: 8px;
        font-size: 16px;
    }
    
    /* Make links easier to tap */
    a {
        padding: 5px 0;
        display: inline-block;
    }
}