:root {
    --background-color-light: #f8f9fa;
    --text-color-light: #212529;
    --primary-color-light: #008080; /* Deep Teal */
    --accent-color-light: #6B8E23; /* Muted Olive Green */
    --card-background-light: #ffffff;
    --code-background-light: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.1);

    --background-color-dark: #121212;
    --text-color-dark: #e0e0e0;
    --primary-color-dark: #008080; /* Deep Teal */
    --accent-color-dark: #6B8E23; /* Muted Olive Green */
    --card-background-dark: #1e1e1e;
    --code-background-dark: #2a2a2a;
    --shadow-color-dark: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--background-color-light);
    color: var(--text-color-light);
    transition: background-color 0.5s, color 0.5s;
    overflow-x: hidden;
}

body.dark-mode {
    background-color: var(--background-color-dark);
    color: var(--text-color-dark);
}

header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

body.dark-mode header {
    background-color: rgba(30, 30, 30, 0.8);
    box-shadow: 0 2px 4px var(--shadow-color-dark);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s;
    color: var(--primary-color-light);
}

body.dark-mode .logo {
    color: var(--primary-color-dark);
}

.logo:hover {
    transform: scale(1.05);
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    background: transparent !important;
    color: var(--primary-color-light);
    border: none !important;
    width: 40px;
    height: 40px;
    border-radius: 0 !important;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none;
    position: relative;
    overflow: visible;
}

body.dark-mode .theme-toggle-btn {
    color: var(--primary-color-dark);
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    background: transparent !important;
}

.theme-toggle-btn:focus {
    outline: none;
    box-shadow: none !important;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    margin-bottom: 6rem;
    animation: fadeIn 1s ease-out;
}

.hero-text {
    max-width: 600px;
    animation: slideInFromLeft 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color-light), var(--accent-color-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite alternate;
}

body.dark-mode .hero h1 {
    background: linear-gradient(45deg, var(--primary-color-dark), var(--accent-color-dark));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color-light);
    margin-bottom: 2rem;
}

body.dark-mode .hero p {
    color: var(--text-color-dark);
}

.hero-image {
    animation: slideInFromRight 1s ease-out;
}

.hero-image img {
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 8px 16px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid var(--primary-color-light);
}

.card-stack {
    position: relative;
    width: 420px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-img {
    position: absolute;
    max-width: 380px;
    max-height: 260px;
    width: auto;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    border: 2px solid var(--primary-color-light);
    transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
    cursor: pointer;
}

.card-img:first-child {
    transform: rotate(-8deg) translateX(-20px);
    z-index: 1;
}
.card-img:last-child {
    transform: rotate(8deg) translateX(20px);
    z-index: 2;
}

.card-img:hover {
    z-index: 3;
    transform: scale(1.08) rotate(0deg) translateX(0px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.28);
}

body.dark-mode .hero-image img {
    border: 2px solid var(--primary-color-dark);
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px var(--shadow-color);
}

body.dark-mode .hero-image img:hover {
    box-shadow: 0 12px 24px var(--shadow-color-dark);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color-light);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 1rem;
    transition: all 0.3s;
    font-weight: 700;
    border: 2px solid var(--primary-color-light);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

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

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 128, 128, 0.4);
}

body.dark-mode .btn {
    background-color: var(--primary-color-dark);
    border: 2px solid var(--primary-color-dark);
}

body.dark-mode .btn:hover {
    box-shadow: 0 5px 15px rgba(0, 128, 128, 0.6);
}

.section {
    margin-bottom: 4rem;
    scroll-margin-top: 80px;
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color-light);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 10px;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color-light), var(--accent-color-light));
    border-radius: 2px;
}

body.dark-mode .section h2 {
    color: var(--primary-color-dark);
}

body.dark-mode .section h2::after {
    background: linear-gradient(to right, var(--primary-color-dark), var(--accent-color-dark));
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: linear-gradient(145deg, var(--card-background-light), #e6e6e6);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 128, 128, 0.1);
    opacity: 1; /* Ensure cards are always visible */
    transform: translateY(0); /* Reset any transform */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color-light), var(--accent-color-light));
}

body.dark-mode .card {
    background: linear-gradient(145deg, var(--card-background-dark), #2a2a2a);
    box-shadow: 0 4px 8px var(--shadow-color-dark);
    border: 1px solid rgba(0, 128, 128, 0.3);
}

body.dark-mode .card::before {
    background: linear-gradient(to right, var(--primary-color-dark), var(--accent-color-dark));
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px var(--shadow-color);
    border: 1px solid var(--primary-color-light);
}

body.dark-mode .card:hover {
    box-shadow: 0 12px 24px var(--shadow-color-dark);
    border: 1px solid var(--primary-color-dark);
}

.card h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary-color-light);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center; /* Center the title content (icon + text) */
    text-align: center; /* Ensure text is centered inside the flex container */
}

body.dark-mode .card h3 {
    color: var(--primary-color-dark);
}

.feature-card {
    text-align: center;
}

.card h3 svg,
.feature-icon svg {
    fill: var(--primary-color-light);
    transition: transform 0.3s;
}

body.dark-mode .card h3 svg,
body.dark-mode .feature-icon svg {
    fill: var(--primary-color-dark);
}

.card h3:hover svg,
.feature-card:hover .feature-icon svg {
    transform: scale(1.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
    display: flex;
    justify-content: center;
}

.feature-card:hover .feature-icon {
    transform: rotate(10deg) scale(1.2);
}

.info-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    text-align: center;
}

.info-list li {
    background-color: var(--card-background-light);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s;
    border: 1px solid rgba(0, 128, 128, 0.1);
    position: relative;
    overflow: hidden;
    opacity: 1; /* Ensure items are always visible */
    transform: translateY(0); /* Reset any transform */
}

.info-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color-light), var(--accent-color-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.info-list li:hover::before {
    transform: scaleX(1);
}

.info-list li:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-color);
    border: 1px solid var(--primary-color-light);
}

body.dark-mode .info-list li {
    background-color: var(--card-background-dark);
    box-shadow: 0 2px 4px var(--shadow-color-dark);
    border: 1px solid rgba(0, 128, 128, 0.3);
}

body.dark-mode .info-list li:hover {
    box-shadow: 0 4px 8px var(--shadow-color-dark);
    border: 1px solid var(--primary-color-dark);
}

.installation-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (min-width: 1200px) {
    .installation-methods {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* .installation-card inherits styles from .card; explicit block removed to avoid empty ruleset */

.apt-installation-card {
    grid-column: 1 / -1;
}

.installation, .usage {
    background-color: var(--card-background-light);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 128, 128, 0.1);
}

.installation::before, .usage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color-light), var(--accent-color-light));
    border-radius: 8px 8px 0 0;
}

body.dark-mode .installation,
body.dark-mode .usage {
    background-color: var(--card-background-dark);
    border: 1px solid rgba(0, 128, 128, 0.3);
}

.installation h2, .usage h2 {
    margin-top: 0;
    color: var(--primary-color-light);
}

body.dark-mode .installation h2,
body.dark-mode .usage h2 {
    color: var(--primary-color-dark);
}

.code-block {
    background-color: var(--code-background-light);
    border-radius: 5px;
    padding: 1rem;
    position: relative;
    margin-top: 1rem;
    border: 1px solid rgba(0, 128, 128, 0.1);
    overflow-x: auto;
}

body.dark-mode .code-block {
    background-color: var(--code-background-dark);
    border: 1px solid rgba(0, 128, 128, 0.3);
}

.code-block pre {
    margin: 0;
    font-family: 'Source Code Pro', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color-light);
}

body.dark-mode .code-block pre {
    color: var(--text-color-dark);
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color-light);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

body.dark-mode .copy-btn {
    background-color: var(--primary-color-dark);
}

body.dark-mode .copy-btn:hover {
    background-color: #005a5a;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    background-color: var(--card-background-light);
    border-top: 1px solid rgba(0, 128, 128, 0.1);
}

body.dark-mode footer {
    background-color: var(--card-background-dark);
    border-top: 1px solid rgba(0, 128, 128, 0.3);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-color-light);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 128, 128, 0.1);
}

.social-links a:hover {
    color: white;
    background-color: var(--primary-color-light);
    transform: translateY(-5px) scale(1.1);
}

body.dark-mode .social-links a {
    color: var(--text-color-dark);
    background-color: rgba(0, 128, 128, 0.3);
}

body.dark-mode .social-links a:hover {
    background-color: var(--primary-color-dark);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.footer-info {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-color-light);
}

body.dark-mode .footer-info {
    color: var(--text-color-dark);
}

.footer-info a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color-light);
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.footer-info a:hover {
    color: var(--primary-color-light);
    background-color: rgba(0, 128, 128, 0.1);
}

body.dark-mode .footer-info a {
    color: var(--text-color-dark);
}

body.dark-mode .footer-info a:hover {
    color: var(--primary-color-dark);
    background-color: rgba(0, 128, 128, 0.3);
}

.footer-info svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@keyframes slideInFromLeft {
    from { 
        opacity: 0; 
        transform: translateX(-50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideInFromRight {
    from { 
        opacity: 0; 
        transform: translateX(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        margin-bottom: 2rem;
    }

    .hero-image {
        margin-top: 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .card-container {
        grid-template-columns: 1fr;
    }

    .info-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animated Background */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.background-shapes li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(0, 128, 128, 0.2);
    animation: float 25s linear infinite;
    bottom: -150px;
    border-radius: 4px;
}

.background-shapes li:nth-child(1) { 
    left: 25%; 
    width: 80px; 
    height: 80px; 
    animation-delay: 0s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.1), rgba(107, 142, 35, 0.1));
}

.background-shapes li:nth-child(2) { 
    left: 10%; 
    width: 20px; 
    height: 20px; 
    animation-delay: 2s; 
    animation-duration: 12s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.2), rgba(107, 142, 35, 0.2));
}

.background-shapes li:nth-child(3) { 
    left: 70%; 
    width: 20px; 
    height: 20px; 
    animation-delay: 4s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.15), rgba(107, 142, 35, 0.15));
}

.background-shapes li:nth-child(4) { 
    left: 40%; 
    width: 60px; 
    height: 60px; 
    animation-delay: 0s; 
    animation-duration: 18s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.1), rgba(107, 142, 35, 0.1));
}

.background-shapes li:nth-child(5) { 
    left: 65%; 
    width: 20px; 
    height: 20px; 
    animation-delay: 0s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.2), rgba(107, 142, 35, 0.2));
}

.background-shapes li:nth-child(6) { 
    left: 75%; 
    width: 110px; 
    height: 110px; 
    animation-delay: 3s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.05), rgba(107, 142, 35, 0.05));
}

.background-shapes li:nth-child(7) { 
    left: 35%; 
    width: 150px; 
    height: 150px; 
    animation-delay: 7s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.1), rgba(107, 142, 35, 0.1));
}

.background-shapes li:nth-child(8) { 
    left: 50%; 
    width: 25px; 
    height: 25px; 
    animation-delay: 15s; 
    animation-duration: 45s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.15), rgba(107, 142, 35, 0.15));
}

.background-shapes li:nth-child(9) { 
    left: 20%; 
    width: 15px; 
    height: 15px; 
    animation-delay: 2s; 
    animation-duration: 35s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.2), rgba(107, 142, 35, 0.2));
}

.background-shapes li:nth-child(10) { 
    left: 85%; 
    width: 150px; 
    height: 150px; 
    animation-delay: 0s; 
    animation-duration: 11s; 
    background: linear-gradient(45deg, rgba(0, 128, 128, 0.08), rgba(107, 142, 35, 0.08));
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Light mode: make rising background shapes dark green */
body:not(.dark-mode) .background-shapes li {
    background: rgba(0, 100, 0, 0.25) !important; /* dark green */
}

.installation-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.installation-card-span-2 {
    grid-column: span 2;
}

.installation-card-span-3 {
    grid-column: span 3;
}

.installation-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* KendoReact Integration Styles */
.k-button {
    background-color: var(--primary-color-light) !important;
    border-color: var(--primary-color-light) !important;
    color: white !important;
}

.k-button:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

body.dark-mode .k-button {
    background-color: var(--primary-color-dark) !important;
    border-color: var(--primary-color-dark) !important;
}

body.dark-mode .k-button:hover {
    background-color: #005a5a !important;
    border-color: #005a5a !important;
}

.k-card {
    border-radius: 8px !important;
    box-shadow: 0 4px 8px var(--shadow-color) !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 128, 128, 0.1) !important;
}

.k-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 16px var(--shadow-color) !important;
}

body.dark-mode .k-card {
    box-shadow: 0 4px 8px var(--shadow-color-dark) !important;
    border: 1px solid rgba(0, 128, 128, 0.3) !important;
}

body.dark-mode .k-card:hover {
    box-shadow: 0 8px 16px var(--shadow-color-dark) !important;
}

.k-card-header {
    background-color: rgba(0, 128, 128, 0.05) !important;
    border-bottom: 1px solid rgba(0, 128, 128, 0.1) !important;
    padding: 1rem !important;
}

body.dark-mode .k-card-header {
    background-color: rgba(0, 128, 128, 0.1) !important;
    border-bottom: 1px solid rgba(0, 128, 128, 0.3) !important;
}

.k-card-title {
    color: var(--primary-color-light) !important;
    margin: 0 !important;
    font-size: 1.25rem !important;
    text-align: center !important; /* Center Kendo card titles */
}

body.dark-mode .k-card-title {
    color: var(--primary-color-dark) !important;
}

.k-card-body {
    padding: 1.5rem !important;
}

.k-grid {
    border: 1px solid rgba(0, 128, 128, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

body.dark-mode .k-grid {
    border: 1px solid rgba(0, 128, 128, 0.3) !important;
}

.k-grid-header {
    background-color: rgba(0, 128, 128, 0.05) !important;
}

body.dark-mode .k-grid-header {
    background-color: rgba(0, 128, 128, 0.1) !important;
}

.k-grid-header .k-header {
    background-color: transparent !important;
    color: var(--primary-color-light) !important;
    font-weight: 600 !important;
    border-color: rgba(0, 128, 128, 0.1) !important;
}

body.dark-mode .k-grid-header .k-header {
    color: var(--primary-color-dark) !important;
    border-color: rgba(0, 128, 128, 0.3) !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .installation-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .installation-card-span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .installation-grid {
        grid-template-columns: 1fr;
    }
    
    .installation-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .installation-card-span-2,
    .installation-card-span-3 {
        grid-column: span 1;
    }
    
    main {
        padding: 1rem;
    }
    
    .section h2 {
        font-size: 2rem;
    }
}