@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Light Mode Colors */
    --primary-bg: #f8f9fa;
    --secondary-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #f8f9fa;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: #334155;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.4);
    --header-bg: rgba(15, 23, 42, 0.95);
    --footer-bg: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--accent-gradient);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-glow);
}

.theme-toggle i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent-primary);
    font-size: 18px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 50px;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.nav:hover {
    background: var(--accent-gradient);
    color: white;
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.nav i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.nav:hover i {
    transform: scale(1.2) rotate(-15deg);
}

/* Headings */
.heading {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin: 40px 0 60px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.heading::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: expandLine 2s ease-in-out infinite;
}

@keyframes expandLine {
    0%, 100% { width: 100px; }
    50% { width: 200px; }
}

/* Grid Layout for Cards */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Card Styles */
.card, .box {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.card:nth-child(1), .box:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2), .box:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3), .box:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4), .box:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5), .box:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6), .box:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7), .box:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8), .box:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9), .box:nth-child(9) { animation-delay: 0.9s; }

.card::before, .box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 0;
}

.card:hover::before, .box:hover::before {
    left: 0;
    opacity: 0.1;
}

.card:hover, .box:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

.card img, .box img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.card:hover img, .box:hover img {
    transform: scale(1.05) rotate(2deg);
    box-shadow: var(--shadow-md);
}

.card h4, .card h2, .box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 15px 0;
    color: var(--accent-primary);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.card:hover h4, .card:hover h2, .box:hover h2 {
    color: var(--accent-secondary);
    transform: scale(1.05);
}

.card p, .box p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

/* Box Container */
.box-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Table Styles */
#myInput {
    width: 100%;
    max-width: 600px;
    padding: 15px 25px;
    margin: 30px auto;
    display: block;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#myInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

#myTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin: 30px 0;
}

#myTable th {
    background: var(--accent-gradient);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1.1rem;
}

#myTable th:first-child {
    border-radius: 10px 0 0 10px;
}

#myTable th:last-child {
    border-radius: 0 10px 10px 0;
}

#myTable tr {
    background: var(--card-bg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#myTable tr:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

#myTable td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

#myTable td:first-child {
    border-left: 1px solid var(--border-color);
    border-radius: 10px 0 0 10px;
}

#myTable td:last-child {
    border-right: 1px solid var(--border-color);
    border-radius: 0 10px 10px 0;
}

#myTable td a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

#myTable td a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--footer-bg);
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 2px solid var(--border-color);
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

footer p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Calculator Styles */
.calculator {
    max-width: 400px;
    margin: 50px auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease-out;
}

.calculator-screen {
    width: 100%;
    height: 80px;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    font-size: 2rem;
    text-align: right;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.calculator-keys button {
    padding: 20px;
    font-size: 1.5rem;
    border: none;
    border-radius: 10px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.calculator-keys button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.calculator-keys button.operator {
    background: var(--accent-gradient);
    color: white;
}

.calculator-keys button.equal-sign {
    background: var(--accent-secondary);
    color: white;
    grid-column: span 2;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.scroll-top i {
    color: white;
    font-size: 24px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .heading {
        font-size: 2rem;
        margin: 30px 0 40px;
    }
    
    .row, .box-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-toggle {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }
    
    .theme-toggle i {
        font-size: 20px;
    }
    
    .nav {
        font-size: 16px;
        padding: 10px 20px;
    }
    
    .card, .box {
        padding: 20px;
    }
    
    .calculator {
        margin: 30px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .heading {
        font-size: 1.8rem;
    }
    
    .card img, .box img {
        height: 180px;
    }
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Particle Background Effect */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: float-particle 10s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Video Gallery Styles */
.video {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    animation: fadeInUp 0.6s ease-out;
}

.video:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.video span {
    display: block;
    width: 100%;
    margin-bottom: 20px;
}

.video iframe {
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.video:hover iframe {
    box-shadow: var(--shadow-glow);
}

.video h2 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.video p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

