* {
    border: 0;
    margin: 0;
    box-sizing: border-box;
}
body {
    background-color: #23232b;
}
/* --- NAVBAR (kept as before, with animation) --- */
.navbar {
    z-index: 1000;
    display: flex;
    height: 60px;
    width: 100%;
    background-color: rgb(255, 255, 255);
    align-items: center;
    position: fixed;
    opacity: .95;
    box-shadow: 0px .1px 3px;
    top: 0;
    left: 0;
    animation: navFadeIn 1.1s;
}
@keyframes navFadeIn {
    from { opacity: 0; transform: translateY(-40px);}
    to { opacity: 1; transform: translateY(0);}
}
.navlogo {
    height: 45px;
    width: 90px;
    margin-left: 30px;
}
.navlogo img {
    height: 45px;
    width: 90px;
    animation: logoPop 1.5s;
}
@keyframes logoPop {
    from { transform: scale(0.7) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}
.navtext ol {
    display: flex;
    gap: 40px;
    margin-left: 25px;
    font-family: cursive;
    color: rgb(75, 84, 81);
    font-weight: bold;
}
.navtext .hov-home a:hover,
.navtext .hov-courses:hover,
.navtext .hov-roadmap:hover,
.navtext .hov-compiler:hover,
.navtext .hov-competitive:hover,
.navtext .hov-aiassiatant:hover,
.navtext .hov-profile:hover {
    color: orange;
    transition: color .3s ease;
    animation: navItemPulse 0.4s;
}
@keyframes navItemPulse {
    0% { color: orange; }
    50% { color: #f6a933; }
    100% { color: orange; }
}
.navtext ol li { list-style: none; }
.navtext ol li a {
    text-decoration: none;
    color: black;
    position: relative;
    transition: color .3s ease;
}
.navtext ol li a:hover {
    color: orange;
    transition: color .3s ease;
}
.navtext ol li a::after {
    display: none !important;
}
.navtext ol li a {
    text-decoration: none !important;
}

@media (max-width: 1150px) {
    .navtext ol {
        gap: 18px;
        font-size: 1rem;
    }
    .navlogo {
        margin-left: 10px;
    }
}
@media (max-width: 900px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding-bottom: 7px;
    }
    .navlogo {
        margin: 10px 0 0 10px;
    }
    .navtext ol {
        margin-left: 10px;
        gap: 10px;
        font-size: 0.97em;
        flex-wrap: wrap;
    }
}

/* Remove the gap between navbar and top image/banner */
.body {
    min-height: 100vh;
    width: 100%;
    background-image: url(../Image/images.jpg);
    background-size: fixed;
    padding-top: 60px;
    animation: pageFadeIn 1.5s;
    margin-top: 0 !important; /* ADDED: Ensure no extra margin above */
}
.top {
    height: 300px;
    padding-top: 0 !important; /* CHANGED: Remove extra space above the image/banner */
    box-shadow: 0px 3px 7px black;
    animation: fadeUp 1.2s;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}

.topic {
    display: flex;
    height: 400px;
    background-color: beige;
    margin: 80px 65px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 1px 1px 10px black;
    position: relative;
    animation: cardEntry 1.2s;
}
@keyframes cardEntry {
    from { opacity: 0; transform: scale(0.93) translateY(70px);}
    70%  { opacity: 1; transform: scale(1.03) translateY(-10px);}
    to   { opacity: 1; transform: scale(1) translateY(0);}
}
.topic:hover {
    box-shadow: 0 6px 30px 5px #00e2ff44, 1px 1px 10px black;
    transform: scale(1.017) rotate(-1deg);
    transition: box-shadow 0.4s, transform 0.4s;
}

.topic-text {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 1095px;
    padding: 20px 50px;
    color: rgb(255, 254, 254);
    animation: fadeLeft 1s;
}
@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-80px);}
    to   { opacity: 1; transform: translateX(0);}
}

.box {
    margin: 80px 65px;
    padding: 40px 50px 75px;
    border-radius: 10px;
    box-shadow: 1px 1px 10px black;
    background-image: url(../Image/360_F_766558841_MQHmRmRpUBpbNaPkPWObFyHSqbvBYNdA.jpg);
    color: aliceblue;
    line-height: 21px;
    max-width: 100vw;
    overflow-x: auto;
    animation: boxPopIn 1.2s;
    transition: box-shadow 0.4s;
}
@keyframes boxPopIn {
    from { opacity: 0; transform: scale(0.95) rotate(-2deg);}
    80% { opacity: 1; transform: scale(1.03) rotate(1deg);}
    to { opacity: 1; transform: scale(1) rotate(0); }
}
.box:hover {
    box-shadow: 0 6px 22px #fdc10077, 1px 1px 10px black;
    transform: scale(1.01) rotate(-0.5deg);
    transition: box-shadow 0.4s, transform 0.3s;
}

.line {
    height: 0.1px;
    background-color: aliceblue;
    margin: 10px 0 35px 0;
    animation: fadeUp 1.3s;
}

table {
    width: 800px;
    border-collapse: collapse;
    margin: auto;
    margin-top: 40px;
    font-size: 1rem;
    word-break: break-word;
    max-width: 98vw;
    animation: tableSlide 1.3s;
}
@keyframes tableSlide {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}
table, th, td {
    border: 1px solid white;
    padding: 8px;
}
th {
    background-color: #222;
}
td {
    background-color: #333;
}
.arithmetic-op,
.relational-op,
.logical-op,
.assignment-op td {
    text-align: center;
}

/* RESPONSIVE STYLES */
@media (max-width: 1200px) {
    .topic-text {
        width: 90vw;
        padding: 18px 2vw;
    }
    .box {
        margin: 60px 16px;
        padding: 25px 10px 50px 10px;
    }
    .topic {
        margin: 60px 16px;
    }
    table {
        width: 97vw;
    }
}

@media (max-width: 900px) {
    .topic {
        height: auto;
        flex-direction: column;
        min-height: 220px;
    }
    .topic-text {
        position: static;
        display: block;
        width: 100%;
        padding: 15px 3vw;
    }
    .box {
        margin: 30px 3vw;
        padding: 20px 6vw 40px 6vw;
    }
    table {
        font-size: 0.95rem;
        width: 99vw;
    }
}

@media (max-width: 600px) {
    .topic {
        margin: 20px 4vw;
        border-radius: 7px;
        min-height: 120px;
    }
    .topic-text {
        padding: 10px 2vw;
        font-size: 0.97em;
    }
    .box {
        margin: 18px 2vw;
        padding: 12px 2vw 20px 2vw;
        border-radius: 5px;
        font-size: 0.98em;
    }
    table {
        width: 100vw;
        font-size: 0.92rem;
        padding: 0;
    }
    th, td {
        padding: 5px 3px;
    }
}

@media (max-width: 420px) {
    .topic {
        margin: 10px 1vw;
        border-radius: 3px;
    }
    .topic-text {
        padding: 4px 2vw;
        font-size: 0.93em;
    }
    .box {
        margin: 8px 1vw;
        padding: 6px 1vw 12px 1vw;
        border-radius: 3px;
        font-size: 0.96em;
    }
    table {
        font-size: 0.89rem;
    }
}