/* Basic Reset & Font */
:root {
    --bg-color-light: #ffffff;
    --text-color-light: #333333; /* Standard Dark Gray */
    --primary-color-light: #e63946; /* Mitra Red - Lighter Shade */
    --secondary-bg-light: #f0f0f0;
    --border-color-light: #dddddd;

    --bg-color-dark: #1a1a1a;
    --text-color-dark: #f0f0f0; /* Bright Off-White */
    --primary-color-dark: #f06a77; /* Brighter, Lighter red for dark mode */
    --secondary-bg-dark: #2c2c2c;
    --border-color-dark: #444444;

    --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --blur-amount: 8px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh; /* Ensure body takes at least full viewport height */
}

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

/* Page wrapper for proper document flow */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Blurred Background */
.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('logo_tr.png');
    background-size: 70% auto; /* Set to specific percentage to make it larger than contain but not overwhelming */
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(var(--blur-amount)) grayscale(100%);
    opacity: 0.12;
    z-index: -1;
    transform: scale(1.2); /* Increased scale for a larger appearance */
    transition: opacity 0.3s, filter 0.3s; /* Smooth transition between modes */
}
body.dark-mode .background-blur {
    opacity: 0.1; /* Increased opacity for better visibility in dark mode */
    filter: blur(var(--blur-amount)) grayscale(60%) brightness(0.9); /* Reduced grayscale and increased brightness */
}


/* Content Wrapper */
.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center header and main-layout horizontally */
    padding: 20px;
    box-sizing: border-box;
    flex: 1; /* Take available space in page wrapper */
    position: relative; /* To sit above the blur */
    z-index: 1;
}

header {
    text-align: center; /* Center content within the header (logo and tagline) */
    align-self: auto; /* Reset align-self to allow centering via align-items on parent */
    margin-bottom: 20px;
    padding: 10px;
    /* background-color: rgba(255, 255, 255, 0.5); */ /* Semi-transparent white */
    background-color: transparent; /* Make header transparent */
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.1); */
    box-shadow: none; /* Remove shadow for a flatter look if desired with transparency */
    max-width: 90%;
}
body.dark-mode header {
    /* background-color: rgba(0, 0, 0, 0.5); */ /* Semi-transparent black */
    background-color: transparent; /* Make header transparent in dark mode */
    /* box-shadow: 0 2px 10px rgba(255,255,255,0.05); */
    box-shadow: none; /* Remove shadow for a flatter look if desired with transparency */
}


.logo {
    width: 150px; /* Adjust as needed, maybe larger for a GIF */
    height: auto;
    margin-bottom: 5px;
    display: block; /* Allows margin auto to work for centering if needed, though text-align on parent is primary */
    margin-left: auto; /* Used with margin-right: auto to center block elements if parent isn't flex/text-aligning */
    margin-right: auto;
}

header h1 {
    margin: 0 0 5px 0;
    font-size: 2.5em;
    color: var(--primary-color-light);
    font-weight: bold;
}
body.dark-mode header h1 {
    color: var(--primary-color-dark);
}

.tagline {
    font-size: 1.2em;
    color: var(--text-color-light);
    margin: 0;
    text-align: center; /* Ensure tagline itself is centered if it has a width */
}
body.dark-mode .tagline {
    color: var(--text-color-dark);
}

/* Main Layout: 2 columns */
.main-layout {
    display: flex;
    /* Removed: justify-content: space-between; */ /* Allow columns to take natural width or be controlled by flex-basis */
    gap: 20px; /* Space between columns */
    width: 100%;
    max-width: 1200px; /* Max width of the main content area */
    margin: 0 auto; /* Center the layout */
    padding: 20px;
}

.instructions-column {
    flex: 1; /* Takes up available space */
    /* Removed: max-width: 60%; */ /* Example: allow it to grow */
    /* Consider adding a min-width if needed */
    background-color: var(--content-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto; /* Allow scrolling if content overflows */
    max-height: 70vh; /* Set a reasonable max height for content */
    padding-bottom: 40px; /* Add extra padding at the bottom for better visibility of last elements */
}


/* Carousel */
.carousel {
    position: relative;
    height: auto; /* Let content define height, but column handles scroll */
}

.carousel-slide {
    display: none; /* Hidden by default */
    animation: fadeEffect 1s; /* Fade animation */
}

.carousel-slide.active {
    display: block; /* Show active slide */
}

.carousel-slide h3 {
    margin-top: 0;
    color: var(--primary-color-light);
}
body.dark-mode .carousel-slide h3 {
    color: var(--primary-color-dark);
}
.carousel-slide h4 {
    margin-top: 1em;
    margin-bottom: 0.5em;
}
.carousel-slide ul {
    padding-left: 20px;
}
.carousel-slide ul ul {
    padding-left: 20px;
}
.carousel-slide li {
    margin-bottom: 0.5em;
}
.carousel-slide strong {
    color: var(--primary-color-light);
}
body.dark-mode .carousel-slide strong {
    color: var(--primary-color-dark);
}


@keyframes fadeEffect {
    from {opacity: .4}
    to {opacity: 1}
}

/* Theme Toggle */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#themeToggle {
    background: var(--secondary-bg-light);
    border: 1px solid var(--border-color-light);
    color: var(--text-color-light);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
body.dark-mode #themeToggle {
    background: var(--secondary-bg-dark);
    border-color: var(--border-color-dark);
    color: var(--text-color-dark);
}

#themeToggle svg {
    width: 20px;
    height: 20px;
}

/* Show sun in light mode, moon in dark mode */
.moon { display: none; }
.sun { display: block; }

body.dark-mode .moon { display: block; }
body.dark-mode .sun { display: none; }

/* Top Controls (User Guide Link & Theme Toggle) */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px; /* Space between link and button */
}

#userGuideLink {
    font-size: 1em;
    color: var(--primary-color-light);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
    border: 1px solid var(--border-color-light);
    transition: background-color 0.3s, color 0.3s;
}

#userGuideLink:hover {
    background-color: var(--primary-color-light);
    color: var(--bg-color-light);
}

body.dark-mode #userGuideLink {
    color: var(--primary-color-dark);
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for dark mode */
    border: 1px solid var(--border-color-dark);
}

body.dark-mode #userGuideLink:hover {
    background-color: var(--primary-color-dark);
    color: var(--bg-color-dark);
}

/* Adjust Theme Toggle Container if it's now part of .top-controls */
.theme-toggle-container {
    position: static; /* No longer fixed, as .top-controls is fixed */
    /* Remove top, right, z-index if they were set, they are now on .top-controls */
}

/* Basic styling for Markdown-generated content */
.instructions-column > h1,
.instructions-column > h2,
.instructions-column > h3,
.instructions-column > h4,
.instructions-column > h5,
.instructions-column > h6 {
    color: var(--primary-color-light);
    margin-top: 1.2em; /* Reduced from 1.5em */
    margin-bottom: 0.4em; /* Reduced from 0.5em */
    font-weight: bold;
}

body.dark-mode .instructions-column > h1,
body.dark-mode .instructions-column > h2,
body.dark-mode .instructions-column > h3,
body.dark-mode .instructions-column > h4,
body.dark-mode .instructions-column > h5,
body.dark-mode .instructions-column > h6 {
    color: var(--primary-color-dark);
}

.instructions-column p {
    margin-bottom: 0.8em; /* Reduced from 1em */
    line-height: 1.6;
}

.instructions-column ul,
.instructions-column ol {
    margin-bottom: 0.8em; /* Reduced from 1em, consistent with p */
    padding-left: 20px;
}

.instructions-column li {
    margin-bottom: 0.3em; /* Reduced from 0.5em */
}

.instructions-column strong {
    color: inherit; /* Changed from var(--primary-color-light) */
    font-weight: bold;
}

body.dark-mode .instructions-column strong {
    color: inherit; /* Changed from var(--primary-color-dark) */
}

.instructions-column em {
    font-style: italic;
}

.instructions-column a {
    color: var(--primary-color-light);
    text-decoration: underline;
}
body.dark-mode .instructions-column a {
    color: var(--primary-color-dark);
}
.instructions-column a:hover {
    text-decoration: none;
}


/* CTA Button Styles */
.cta-button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #0056b3;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    color: #333; /* Text color for light mode modal */
    margin: 10% auto; /* 10% from the top and centered */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}

/* Dark mode specific styles for modal content */
body.dark-mode .modal-content {
    background-color: #333; /* Dark background for modal in dark mode */
    color: #fefefe; /* Light text for modal in dark mode */
    border-color: #555;
}


.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

body.dark-mode .close-button {
    color: #ccc;
}

body.dark-mode .close-button:hover,
body.dark-mode .close-button:focus {
    color: white;
}


/* Form Element Styles */
#betaForm label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
}

#betaForm input[type="text"],
#betaForm input[type="email"],
#betaForm select,
#betaForm textarea {
    width: calc(100% - 22px); /* Full width minus padding and border */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* So padding doesn't add to width */
    transition: border-color 0.3s, box-shadow 0.3s;
}

#betaForm input:required:valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}

#betaForm input:focus:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}

body.dark-mode #betaForm input[type="text"],
body.dark-mode #betaForm input[type="email"],
body.dark-mode #betaForm select,
body.dark-mode #betaForm textarea {
    background-color: #444;
    color: #f1f1f1;
    border-color: #666;
}


#betaForm .checkbox-container {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

#betaForm input[type="checkbox"] {
    margin-right: 8px;
    width: auto; /* Override width for checkbox */
}
#betaForm .checkbox-label {
    font-weight: normal; /* Labels for checkboxes usually aren't bold */
    margin-top: 0;
    margin-bottom: 0;
}

.tier-description, .cloud-trial-description {
    margin-bottom: 15px;
    color: #666;
    font-style: italic;
    transition: visibility 0.3s, opacity 0.3s;
}

body.dark-mode .tier-description, 
body.dark-mode .cloud-trial-description {
    color: #aaa;
}

/* Tier Specifications styling */
.tier-specs {
    margin-top: 10px;
    background-color: rgba(240, 240, 240, 0.5);
    border-radius: 6px;
    padding: 10px;
    font-size: 0.9em;
}

body.dark-mode .tier-specs {
    background-color: rgba(50, 50, 50, 0.5);
}

.tier-specs p {
    margin: 6px 0;
}

.tier-specs strong {
    color: var(--primary-color-light);
    font-weight: bold;
}

body.dark-mode .tier-specs strong {
    color: var(--primary-color-dark);
}

/* Summary Tier Specifications styling */
.summary-tier-specs {
    margin-top: -5px;
    margin-bottom: 15px;
    background-color: rgba(240, 240, 240, 0.3);
}

body.dark-mode .summary-tier-specs {
    background-color: rgba(50, 50, 50, 0.3);
}

#betaFormSummary .tier-specs p {
    margin: 0;
    padding: 5px;
}

@media (max-width: 768px) {
    .tier-specs {
        font-size: 0.8em;
    }
}

/* Form validation message styles */
.error-message {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
}

input:focus:invalid + .error-message {
    display: block;
}

#betaForm .submit-button {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#betaForm .submit-button:hover {
    background-color: #218838;
}

/* Beta Form Summary Styles */
#betaFormSummary {
    padding: 15px 0;
}

#betaFormSummary h3 {
    margin-top: 0;
    color: var(--primary-color-light);
}

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

#betaFormSummary p {
    margin: 10px 0;
    line-height: 1.5;
}

#betaFormSummary .button-row {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

#betaFormSummary .secondary-button {
    background-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#betaFormSummary .secondary-button:hover {
    background-color: #5a6268;
}

#betaFormSummary .submit-button {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#betaFormSummary .submit-button:hover {
    background-color: #218838;
}

/* Responsive Adjustments (Example) */
@media (max-width: 768px) {
    .top-controls {
        flex-direction: column; /* Stack items vertically */
        align-items: flex-end; /* Align items to the right */
        gap: 10px; /* Adjust gap for vertical stacking */
        /* You might want to adjust top/right if they feel too close to the edge */
         right: 10px; /* Example: pull slightly from edge */
         top: 10px;   /* Example: pull slightly from edge */
    }

    #userGuideLink {
        /* Optional: Adjust padding or font size if needed for stacked view */
        padding: 6px 10px;
        font-size: 0.9em;
    }

    #themeToggle {
        /* Optional: Adjust padding or size if needed */
        padding: 6px;
    }

    #themeToggle svg {
        width: 18px; /* Slightly smaller icon for compact view */
        height: 18px;
    }

    .main-layout {
        flex-direction: column;
        height: auto; /* Allow content to flow */
        overflow-y: auto; /* Main scrollbar for content area */
        width: 100%;
        padding: 10px; /* Reduced padding for mobile */
    }
    .instructions-column { /* Adjusted for better mobile scrolling */
        max-height: none; /* Allow content to define height */
        overflow-y: auto; /* Enable scrolling within column */
        flex-basis: auto; /* Content dictates basis */
        margin-bottom: 30px; /* Add space at bottom for better visibility */
        padding-bottom: 30px; /* Extra padding at the bottom */
    }

    header h1 {
        font-size: 2em;
    }
    .tagline {
        font-size: 1em;
    }
    .logo {
        width: 100px;
    }
    .content-wrapper {
        padding: 10px;
    }
}

/* Embedded content and iframe styling */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    margin: 1.5em 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

body.dark-mode .video-container {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .video-container iframe {
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

/* Main Footer Styles */
.main-footer {
    padding: 40px 20px 20px;
    background-color: var(--secondary-bg-light);
    border-top: 1px solid var(--border-color-light);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

body.dark-mode .main-footer {
    background-color: var(--secondary-bg-dark);
    border-top-color: var(--border-color-dark);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary-color-light);
    background-color: rgba(230, 57, 70, 0.1);
}

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

body.dark-mode .footer-links a:hover {
    color: var(--primary-color-dark);
    background-color: rgba(240, 106, 119, 0.1);
}

.socials-group {
    display: inline-flex; /* Changed from flex to inline-flex */
    align-items: center;
    gap: 10px; /* Maintain gap between social items */
    flex-wrap: nowrap; /* Prevent social group from wrapping internally */
}

.follow-us-text {
    color: var(--text-color-light);
    font-size: 14px;
    font-weight: 500;
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.social-link svg {
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.1);
}

.footer-separator {
    color: var(--border-color-light);
    font-size: 14px;
}

body.dark-mode .footer-separator {
    color: var(--border-color-dark);
}

.footer-copyright {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 10px;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .footer-separator {
        display: none;
    }
    
    .main-footer {
        padding: 20px 15px 15px;
    }
    
    .socials-group {
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
    }
    
    .follow-us-text {
        margin-bottom: 10px;
        display: block;
        font-weight: 600;
    }
    
    .social-link {
        margin: 5px 0;
        justify-content: center;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .instructions-column {
        max-height: 60vh;
    }
}