/* === Global Reset (Override Bootstrap defaults where necessary) === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Base (Light Mode) Theme === */
:root {
    --bs-primary: #32062e;
    --bs-primary-rgb: 50, 6, 46;
    --accent-color: #4a0a3f;
    --primary-color: #32062e;
    --secondary-color: #4a0a3f;
    --text-color: #333333;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --shadow: 0 10px 30px rgba(50, 6, 46, 0.1);
    --shadow-hover: 0 20px 40px rgba(50, 6, 46, 0.15);
    --success-color: #28a745;
}

/* === Dark Mode Theme Overrides === */
.dark-mode {
    --bs-primary: #e5d2e1;
    --bs-primary-rgb: 229, 210, 225;
    --accent-color: #f06292;
    --primary-color: #e5d2e1;
    --secondary-color: #f8bbd0;
    --text-color: #f1f1f1;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --glass-bg: rgba(18, 18, 18, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.6);
    --success-color: #2ecc71;
}

/* === Override Bootstrap defaults to match original styling === */
body {
    font-family: 'Inter', sans-serif !important;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    overflow-x: hidden;
}

/* === Links Styling for Accessibility === */
a {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
}

a:hover,
a:focus {
    color: var(--accent-color);
    text-decoration: underline;
    outline: none;
}

.dark-mode a {
    color: var(--bs-primary);
}

.dark-mode a:hover,
.dark-mode a:focus {
    color: var(--accent-color);
}

/* === Navigation === */
.navbar {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.nav-container {
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex !important;
    gap: 2rem;
    align-items: center;
    flex-direction: row;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bs-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991.98px) {
    .nav-menu {
        flex-direction: column !important;
        background: var(--glass-bg);
        padding: 1rem;
        gap: 1rem;
        width: 100%;
    }
}

/* === Hero Section === */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: #fff;
    padding-top: 6rem; /* Prevents content from hiding under fixed navbar */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-container {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: slideInUp 1s ease-out;
}

.hero-content .highlight {
    background: linear-gradient(90deg, #6366f1, #4f46e5, #32062e, #f8f9fa, #6366f1);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerGradient 3s linear infinite;
}

@keyframes shimmerGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: slideInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    animation: slideInUp 1s ease-out 0.4s both;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: #fff !important;
    box-shadow: var(--shadow);
    border: none !important;
}

.btn-primary:hover {
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color)) !important;
}

.btn-secondary {
    background: var(--glass-bg) !important;
    color: var(--text-color) !important;
    border: 2px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background: var(--accent-color) !important;
    color: #fff !important;
}

.hero-stats {
    animation: slideInUp 1s ease-out 0.6s both;
}

.stat {
    color: #fff;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    background: linear-gradient(135deg, #fff, #e5d2e1, #f8bbd0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-visual {
    animation: slideInRight 1s ease-out 0.3s both;
}

.dashboard-mockup {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.dashboard-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mockup-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #28ca42; }

.mockup-content {
    background: rgba(var(--bs-primary-rgb), 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.pulse-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.pulse-dot:nth-child(1) { top: 20%; left: 30%; animation-delay: 0s; }
.pulse-dot:nth-child(2) { top: 60%; left: 70%; animation-delay: 0.5s; }
.pulse-dot:nth-child(3) { top: 40%; left: 50%; animation-delay: 1s; }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* === Features Section === */
.features {
    padding: 8rem 0;
    background: var(--background-color);
    color: var(--text-color);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.25rem;
    opacity: 0.8;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    border-radius: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--bs-primary-rgb), 0.05), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--bs-primary);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    position: relative;
}

.feature-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover .feature-icon::after {
    opacity: 0.3;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-description {
    opacity: 0.8;
    line-height: 1.6;
}

/* === Revenue Section === */
.revenue {
    padding: 8rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    position: relative;
    overflow: hidden;
}

.revenue::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="%236366f1" stop-opacity="0.1"/><stop offset="100%" stop-color="%2306b6d4" stop-opacity="0.1"/></linearGradient></defs><circle cx="100" cy="100" r="50" fill="url(%23grad)"/><circle cx="900" cy="200" r="80" fill="url(%23grad)"/><circle cx="200" cy="800" r="60" fill="url(%23grad)"/></svg>');
    animation: float 25s ease-in-out infinite reverse;
}

.revenue-container {
    position: relative;
    z-index: 2;
}

.revenue-header h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.revenue-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.revenue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--success-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.revenue-card:hover::before {
    transform: scaleX(1);
}

.revenue-card:hover {
    transform: translateY(-10px);
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.revenue-card,
.revenue-card h3,
.revenue-card p {
    color: var(--text-color) !important;
}

.revenue-card:hover,
.revenue-card:hover h3,
.revenue-card:hover p {
    color: #fff !important;
}

.revenue-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.revenue-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.revenue-card p {
    opacity: 0.8;
    line-height: 1.6;
}

.stat-card {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 15px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #e5d2e1, #f8bbd0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    opacity: 0.8;
    font-size: 1rem;
}

/* === Setup Card Specific Styles === */
.setup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.setup-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    position: relative;
}

.setup-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.setup-card:hover .setup-icon::after {
    opacity: 0.3;
}

.setup-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.setup-description {
    opacity: 0.8;
    line-height: 1.6;
    font-size: 0.9rem;
}

.setup-description code {
    background: rgba(var(--bs-primary-rgb), 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    color: var(--bs-primary);
    font-size: 0.95em;
    margin: 0 2px;
}

/* === Troubleshooting List Enhancements === */
.troubleshooting-list li {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    border-radius: 20px;
    margin-bottom: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.troubleshooting-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--bs-primary-rgb), 0.05), transparent);
    transition: left 0.5s ease;
}

.troubleshooting-list li:hover::before {
    left: 100%;
}

.troubleshooting-list li:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--bs-primary);
}

.troubleshooting-list i {
    color: var(--bs-primary);
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* === Devices Table Responsive Fix === */
@media (max-width: 576px) {
    .devices-table .table th,
    .devices-table .table td {
        padding: 0.5rem;
        font-size: 0.95rem;
    }
}

/* === Alert Icon Alignment Fix === */
.alert i {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* === Animations === */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .feature-card {
        padding: 1.25rem;
    }
    .feature-title {
        font-size: 1rem;
    }
}

/* === Smooth Scrolling === */
html {
    scroll-behavior: smooth;
}

/* === Loading Animation === */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Features/Steps/Setup/Integration/Troubleshooting/Resources Sections === */
.devices,
.steps,
.setup,
.integration,
.troubleshooting,
.resources,
.pricing,
.hardware,
.faq {
    padding: 6rem 0;
    background: var(--background-color);
    color: var(--text-color);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.25rem;
    opacity: 0.8;
}

/* === Card Styles (Unified) === */
.feature-card,
.step-card,
.setup-card,
.integration-card,
.api-section,
.troubleshooting-list li,
.resources-list li,
.pricing-card,
.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 2rem;
    border-radius: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    /* For animation: */
    opacity: 1;
    transform: translateY(0);
}

/* Animated gradient hover effect for all cards */
.feature-card::before,
.step-card::before,
.setup-card::before,
.integration-card::before,
.api-section::before,
.troubleshooting-list li::before,
.resources-list li::before,
.pricing-card::before,
.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--bs-primary-rgb), 0.05), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before,
.step-card:hover::before,
.setup-card:hover::before,
.integration-card:hover::before,
.api-section:hover::before,
.troubleshooting-list li:hover::before,
.resources-list li:hover::before,
.pricing-card:hover::before,
.faq-item:hover::before {
    left: 100%;
}

.feature-card:hover,
.step-card:hover,
.setup-card:hover,
.integration-card:hover,
.api-section:hover,
.troubleshooting-list li:hover,
.resources-list li:hover,
.pricing-card:hover,
.faq-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--bs-primary);
}

/* === Accessibility Improvements === */

/* Focus styles for interactive cards and navigation */
.action-card:focus-visible,
.feature-card:focus-visible,
.step-card:focus-visible,
.setup-card:focus-visible,
.integration-card:focus-visible,
.api-section:focus-visible,
.troubleshooting-list li:focus-visible,
.resources-list li:focus-visible,
.pricing-card:focus-visible,
.faq-item:focus-visible,
.nav-item:focus-visible,
.setting-item:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    z-index: 2;
}

/* Ensure sufficient color contrast for focus */
.action-card:focus-visible,
.feature-card:focus-visible,
.step-card:focus-visible,
.setup-card:focus-visible,
.integration-card:focus-visible,
.api-section:focus-visible,
.troubleshooting-list li:focus-visible,
.resources-list li:focus-visible,
.pricing-card:focus-visible,
.faq-item:focus-visible {
    box-shadow: 0 0 0 4px rgba(50, 6, 46, 0.15);
}

/* Visually hide elements but keep them accessible to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* Ensure sufficient contrast for badges and status indicators */
.badge,
[role="status"] {
    color: #222;
    background: #f1f1f1;
}

.badge.bg-primary,
.badge.bg-secondary {
    color: #fff !important;
}

/* Improve focus for buttons and links */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(50, 6, 46, 0.15);
    z-index: 2;
}