/* =====================
   Global Styles
   ===================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #e6f1ff; /* The dark base */
    /* This creates a deep, dark adventurous base */
    background-image: url('https://www.transparenttextures.com/patterns/foggy-birds.png');
    background-attachment: fixed;
    background: linear-gradient(-45deg, #020617, #0f172a, #1e293b, #020617);
    background-size: 400% 400%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Apply both animations: one for color shift, one for "breathing" */
    animation: gradientShift 15s ease infinite, breatheEffect 8s ease-in-out infinite;
    background-attachment: fixed; /* Keeps the background still while content scrolls */
    color: #e6f1ff; /* Ensures all text is readable against the dark background */
}
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -2;
        background: linear-gradient(-45deg, #020617, #0f172a, #1e293b, #020617);
        background-size: 400% 400%;
        animation: gradientShift 15s ease infinite;
    }

/* 1. The Color Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 2. The Pulsing Glow */
@keyframes breatheEffect {
    0%, 100% {
        filter: brightness(100%);
    }

    50% {
        filter: brightness(125%);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.table {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

a {
    color: #4a90e2;
    text-decoration: none;
    transition: color 0.3s ease;
}

    a:hover {
        color: #2c6cb0;
    }

/* =====================
   Header
   ===================== */
header {
    background: linear-gradient(135deg, #1d3557, #457b9d);
    color: #fff;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

    header h1 {
        margin: 0;
        font-size: 1.8rem;
        letter-spacing: 1px;
        font-weight: 600;
    }

/* =====================
   navbar
   ===================== */
/* Deep Dark Riddle Theme */
.bg-dark-riddle {
    background-color: #0d1117; /* Very deep charcoal/black */
}

.navbar-brand {
    letter-spacing: 2px;
    font-size: 1.4rem;
}

/* Minimal Hover Effect */
.hover-underline {
    position: relative;
    transition: color 0.3s ease;
}

    .hover-underline::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 5px;
        left: 10%;
        background-color: #0d6efd; /* Your primary color */
        transition: width 0.3s ease;
    }

    .hover-underline:hover::after {
        width: 80%;
    }

    .hover-underline:hover {
        color: #fff !important;
    }


/* Subtle Italic for Search */
.italic {
    font-style: italic;
    font-size: 0.95rem;
}

/* =====================
   Content Area
   ===================== */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}
.mist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/foggy-birds.png');
    opacity: 0.8;
    z-index: -1; /* Sits behind everything except the body background */
    animation: mistDrift 60s linear infinite;
}

@keyframes mistDrift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 1000px 1000px;
    }
}
/* =====================
   Buttons
   ===================== */
button, .btn {
    background: #457b9d;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

    button:hover, .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(80,150,255,0.35);
    }

/* =====================
   Footer
   ===================== */
footer {
    background: #1d3557;
    color: #f1f1f1;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.footer-tag {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2); /* Glass effect */
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 50px; /* Pill shape */
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    color: #f1f1f1;
    transition: all 0.3s ease;
    z-index: 1000;
}

    .footer-tag:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .footer-tag a {
        color: #007bff;
        text-decoration: none;
        font-weight: bold;
        margin-left: 5px;
    }

/*Riddle search view*/
.custom-search .form-control:focus {
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.25);
    border-color: #0d6efd;
}

.custom-search .btn-primary {
    transition: all 0.2s ease-in-out;
}

    .custom-search .btn-primary:hover {
        transform: scale(1.02);
        filter: brightness(1.1);
    }

/* Optional: Make the "Search" title pop */
h2.display-6 {
    font-weight: 300;
    color: #60a5fa;
}

/*Create new riddle*/
/* Make the input boxes feel softer */
.form-floating > .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.2);
}
.form-floating > label {
    color: #495057 !important; /* Darker gray for the label */
}
.card {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
}
/* Table Styling */
.custom-table {
    background: rgba(29, 53, 87, 0.85);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

    .custom-table th {
        background: #1d3557;
        color: #f1faee;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .custom-table td {
        vertical-align: middle;
        font-size: 1rem;
        padding: 1rem;
    }

/* Question text */
.question-text {
    font-weight: 500;
    font-size: 1.1rem;
    color: #f1faee;
}

/* Vote buttons */
.vote-buttons {
    margin-top: 6px;
}

.vote-btn {
    display: inline-block;
    margin-right: 6px;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s ease, color 0.3s ease;
}

    .vote-btn.upvote:hover {
        color: #2ecc71;
        transform: scale(1.2);
    }

    .vote-btn.downvote:hover {
        color: #e74c3c;
        transform: scale(1.2);
    }

/* Vote counts */
.vote-counts {
    margin-top: 8px;
    font-size: 0.95rem;
}

    .vote-counts .up {
        color: #2ecc71;
        margin-right: 10px;
    }

    .vote-counts .down {
        color: #e74c3c;
    }

/* Action buttons */
.btn {
    margin: 0 3px;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

    .btn:hover {
        transform: translateY(-2px);
    }

.cool-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1d3557;
    text-decoration: none;
    letter-spacing: 1px;
    transition: transform 0.3s ease, color 0.3s ease;
}

    .cool-logo:hover {
        color: #457b9d;
        transform: scale(1.05);
    }

    .cool-logo .logo-sub {
        display: block;
        font-size: 0.8rem;
        font-weight: 400;
        color: #a8dadc;
        letter-spacing: 2px;
        text-transform: uppercase;
    }
/* Gradient background for navbar */
.bg-gradient {
    background: linear-gradient(90deg, #1d3557, #457b9d, #e63946);
}

/* Brand Logo Text */
.gradient-logo {
    font-size: 1.6rem;
    font-weight: bold;
    background: linear-gradient(45deg, #f1faee, #a8dadc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

    .gradient-logo:hover {
        transform: scale(1.1);
    }

/* Navbar links */
.navbar-nav .nav-link {
    font-weight: 500;
    color: #f1faee !important;
    margin: 0 8px;
    transition: color 0.3s, transform 0.3s;
}

    .navbar-nav .nav-link:hover {
        color: #ffe066 !important;
        transform: translateY(-2px);
    }

/* Shadow effect */
.shadow-lg {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

.navbar-nav .nav-item .nav-link {
    padding: 8px 14px;
    border-radius: 20px;
    transition: background 0.3s, transform 0.3s;
}

    .navbar-nav .nav-item .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: scale(1.05);
    }

.navbar-nav .nav-item .btn-login {
    background: #e63946;
    color: #fff !important;
    border-radius: 20px;
    padding: 6px 14px;
    font-weight: 600;
    margin-left: 10px;
    transition: background 0.3s;
}

    .navbar-nav .nav-item .btn-login:hover {
        background: #d62828;
    }

.typewriter {
    background-color: rgba(173, 216, 230, 0.4);
    /* Smooths out the corners for a modern feel */
    border-radius: 8px;
    justify-content: center; /*horizontal center*/
    white-space: normal;
    text-align: center;
    overflow: hidden;
    display: flex;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    visibility: hidden; /* start invisible */
    animation: typing 1s steps(40, end);
    opacity: 55%;
}

.homepage-intro p {
    margin: 0.5rem 0;
    background-color: aquamarine;
    color: black;
    font-size: clamp(1.2rem, 4vw, 2rem);
}

.details-box {
    background-color: rgba(29, 53, 87, 0.5); /* white with 50% transparency */
    padding: 25px;
    border-radius: 10px;
    color:white;
}

.details-box2 {
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg,#60a5fa,#a78bfa,#38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
}
/* Riddle answer reveal animation */

.riddle-answer {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffe066;
    opacity: 0;
    transform: scale(0.7);
    animation: answerPop 0.6s ease-out forwards;
    text-shadow: 0 0 8px rgba(255, 224, 102, 0.7);
}

/* Pop animation */
@keyframes answerPop {

    0% {
        opacity: 0;
        transform: scale(0.6);
    }

    60% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/*responsivness*/
img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {

    .navbar-nav .nav-link {
        margin: 4px 0;
        text-align: center;
    }

    .navbar-nav .nav-item .btn-login {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* =====================
   Mobile Responsive
   ===================== */

@media (max-width: 768px) {

    header {
        padding: 1rem;
        text-align: center;
    }

        header h1 {
            font-size: 1.4rem;
        }

    .custom-table td {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .vote-btn {
        font-size: 1rem;
    }

    button, .btn {
        width: 100%;
        margin-top: 6px;
    }

    .details-box {
        padding: 15px;
    }
}
/*riddle table responsive view*/
.riddle-card {
    background: rgba(255, 255, 255, 0.6); /* Your Light Blue/White Misty look */
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

    .riddle-card:hover {
        transform: translateY(-3px);
        background: rgba(255, 255, 255, 0.8);
    }

.question-label {
    color: #457b9d;
    letter-spacing: 1px;
    font-weight: 700;
}

.question-text {
    color: #1d3557;
}

/* Fixes for mobile buttons */
@media (max-width: 768px) {
    .btn-sm {
        padding: 10px 15px; /* Bigger tap targets for fingers */
    }

}


