/* Cloud-Themed Styling for Celestial */

:root {
    --primary-color: #87CEEB; /* Sky blue */
    --secondary-color: #F0F8FF; /* Alice blue */
    --accent-color: #FFE4E1; /* Misty rose */
    --light-color: #FFFFFF; /* White */
    --dark-color: #4682B4; /* Steel blue */
    --success-color: #98FB98; /* Pale green */
    --warning-color: #FFD700; /* Gold */
    --info-color: #87CEFA; /* Light sky blue */
    --text-light: #FFFFFF;
    --text-dark: #2F4F4F; /* Dark slate gray */
    --shadow: 0 4px 12px rgba(135, 206, 235, 0.25);
    --border-radius: 15px;
}

/* Cloud background with animated clouds */
body {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Floating clouds in background */
.cloud {
    position: absolute;
    z-index: -1;
    opacity: 0.8;
}

.cloud-1 {
    top: 10%;
    left: 5%;
    width: 100px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float 25s infinite linear;
}

.cloud-1:before {
    content: '';
    position: absolute;
    top: -20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.cloud-1:after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.cloud-2 {
    top: 25%;
    left: 40%;
    width: 150px;
    height: 50px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: float 30s infinite linear;
    animation-delay: 2s;
}

.cloud-2:before {
    content: '';
    position: absolute;
    top: -25px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.cloud-2:after {
    content: '';
    position: absolute;
    top: -20px;
    left: 70px;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.cloud-3 {
    top: 60%;
    left: 70%;
    width: 120px;
    height: 45px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 35s infinite linear;
    animation-delay: 4s;
}

.cloud-3:before {
    content: '';
    position: absolute;
    top: -22px;
    left: 25px;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

.cloud-3:after {
    content: '';
    position: absolute;
    top: -18px;
    left: 60px;
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

.cloud-4 {
    top: 75%;
    left: 15%;
    width: 80px;
    height: 35px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    animation: float 28s infinite linear;
    animation-delay: 1s;
}

.cloud-4:before {
    content: '';
    position: absolute;
    top: -18px;
    left: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
}

.cloud-4:after {
    content: '';
    position: absolute;
    top: -15px;
    left: 40px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
}

.cloud-5 {
    top: 45%;
    left: 25%;
    width: 110px;
    height: 42px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    animation: float 32s infinite linear;
    animation-delay: 3s;
}

.cloud-5:before {
    content: '';
    position: absolute;
    top: -22px;
    left: 22px;
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
}

.cloud-5:after {
    content: '';
    position: absolute;
    top: -18px;
    left: 58px;
    width: 62px;
    height: 62px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
}

.cloud-6 {
    top: 15%;
    left: 75%;
    width: 90px;
    height: 38px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: float 27s infinite linear;
    animation-delay: 5s;
}

.cloud-6:before {
    content: '';
    position: absolute;
    top: -19px;
    left: 18px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.cloud-6:after {
    content: '';
    position: absolute;
    top: -16px;
    left: 45px;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

@keyframes float {
    0% {
        transform: translateX(-100px);
    }
    100% {
        transform: translateX(calc(100vw + 200px));
    }
}

/* Button Styles */
.custom-btn {
    border: 2px solid var(--primary-color) !important;
    color: var(--text-dark) !important;
    background-color: var(--light-color) !important;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.custom-btn:hover {
    background-color: var(--secondary-color) !important;
    border-color: var(--dark-color) !important;
    color: var(--text-dark) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(135, 206, 235, 0.3);
}

.custom-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(135, 206, 235, 0.5) !important;
}

/* Button with cloud effect */
.custom-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

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

/* Sign In Form Styles */
#sign-in-div {
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    margin: 5% auto;
    color: var(--text-dark);
    border: none;
    border-radius: var(--border-radius);
    background-color: white;
    position: relative;
    width: 90%;
    max-width: 500px;
    height: auto;
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
}

#sign-in-div::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(135, 206, 235, 0.1) 0%, transparent 70%);
    z-index: -1;
}

#sign-in {
    margin-bottom: 10%;
}

#sign-in-submit {
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, var(--primary-color), var(--info-color));
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: white;
    width: 100%;
    margin-top: 5%;
    margin-bottom: 5%;
    padding: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#sign-in-submit:hover {
    background: linear-gradient(to right, var(--dark-color), var(--primary-color));
    border-color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(135, 206, 235, 0.4);
}

#sign-in-form input[type="text"],
#sign-in-form input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 16px;
    background-color: var(--secondary-color);
}

#sign-in-form input[type="text"]:focus,
#sign-in-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.3);
    background-color: white;
}

#sign-in-form input[type="submit"] {
    padding: 12px;
    background: linear-gradient(to right, var(--primary-color), var(--info-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#sign-in-form input[type="submit"]:hover {
    background: linear-gradient(to right, var(--dark-color), var(--primary-color));
}

/* Navigation Bar Styles */
.navbar {
    background: linear-gradient(to right, var(--primary-color), var(--info-color)) !important;
    box-shadow: var(--shadow);
    padding: 10px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.navbar-brand img {
    border: none;
    transition: transform 0.3s ease;
    box-shadow: none;
    border-radius: 0;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 8px;
    border-radius: 30px;
    padding: 8px 15px !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::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: 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-3px);
    color: var(--text-light) !important;
}

.score-display {
    background: linear-gradient(to right, var(--primary-color), var(--dark-color));
    border-radius: 50px;
    padding: 8px 20px;
    margin-left: 15px;
    font-weight: bold;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* Content Container */
.container.mt-4 {
    margin-top: 2rem !important;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(5px);
}

/* Home Page Styles */
.custom-margin {
    margin-left: 0.1% !important;
}

.btn-outline-primary.custom-btn {
    border-width: 2px;
    font-size: 1.2rem;
    padding: 15px;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    background-color: white;
    position: relative;
    overflow: hidden;
}

/* Books Section */
#books {
    font-size: 44px;
    margin: 20px 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    text-align: center;
    color: var(--dark-color);
    display: block;
    text-decoration: none;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(200, 230, 255, 0.5);
}

/* Book/Movie Detail Page */
#read-book {
    margin-top: 2vh;
    margin-left: 4vw;
    width: 90vw;
    height: 75vh;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--secondary-color);
    background-color: white;
}

/* Leaderboard Styles */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: rgba(255, 255, 255, 0.8);
}

.table thead th {
    background: linear-gradient(to bottom, var(--primary-color), var(--dark-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.3s ease;
    background-color: white;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(135, 206, 235, 0.1);
}

.table tbody tr:hover {
    background-color: rgba(173, 216, 230, 0.3) !important;
}

.table {
    background-color: transparent;
    margin-bottom: 0;
}

.table td, .table th {
    vertical-align: middle;
    padding: 12px 15px;
}

.badge.leaderboard-badge {
    color: var(--text-light) !important;
    background: linear-gradient(to right, var(--primary-color), var(--dark-color));
    font-size: 1em;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Form Controls */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid var(--secondary-color);
    padding: 10px 15px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(135, 206, 235, 0.3);
    background-color: white;
}

/* Card Styles */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(135, 206, 235, 0.1) 0%, transparent 70%);
    z-index: 0;
    transition: all 0.5s ease;
}

.card:hover::before {
    transform: scale(1.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(135, 206, 235, 0.3);
}

.card-body {
    position: relative;
    z-index: 1;
}

.card-header {
    background: linear-gradient(to right, var(--primary-color), var(--info-color));
    color: white;
    border: none;
    font-weight: 600;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Footer */
footer {
    background: linear-gradient(to right, var(--primary-color), var(--dark-color));
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

/* Carousel styles */
.carousel {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.carousel-item img {
    border-radius: var(--border-radius);
}

/* Carousel controls */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(70, 130, 180, 0.7); /* Steel blue with transparency */
    border: 2px solid white;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: rgba(70, 130, 180, 0.9); /* Darker blue on hover */
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1); /* Make the icons white */
    width: 20px;
    height: 20px;
}

/* Cloud-themed elements */
.cloud-element {
    background: linear-gradient(to bottom, #ffffff, #f0f8ff);
    border: 1px solid #d0e8ff;
    border-radius: 50px 50px 20px 20px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(135, 206, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.cloud-element::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg,
                transparent 0%,
                rgba(255, 255, 255, 0.1) 25%,
                transparent 50%,
                rgba(255, 255, 255, 0.1) 75%,
                transparent 100%);
    z-index: -1;
    animation: shine 3s infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #sign-in-div {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .navbar-brand img {
        max-width: 70px;
    }

    #books {
        font-size: 32px;
    }

    .nav-link {
        font-size: 1rem;
        padding: 6px 10px !important;
        margin: 0 5px;
    }

    .container.mt-4 {
        padding: 10px;
    }
}