:root {
    /* Inner shadow */
    --shadow-offset: 0;
    --shadow-blur: 20px;
    --shadow-spread: -5px;
    --shadow-color: rgba(255, 255, 255, 0.7);

    /* Painted glass */
    --tint-color: 255, 255, 255;
    --tint-opacity: 0.4;

    /* Background frost */
    --frost-blur: 2px;

    /* SVG noise/distortion */
    --noise-frequency: 0.008;
    --distortion-strength: 77;

    /* Outer shadow blur */
    --outer-shadow-blur: 24px;

    /* Initial UI Values - Edit these to change defaults */
    --initial-text-content: "Your Text Here";
    --initial-font-size: 32px;
    --initial-font-color: #333333;
    --initial-background-url: "image.jpg";
    --initial-tint-color: #ffffff;
    --initial-shadow-color: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #7792bb 0%, #293d5e 100%);
    font-family: 'Arial', sans-serif;
    font-weight: 300;
    position: relative;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: #333;
}

/* Header Section */
.site-header {
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.header-content h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.header-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Content wrapper for consistent padding */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Content sections */
section {
    background: rgba(255, 255, 255, 0.95);
    margin: 2rem auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    width: calc(100% - 2rem);
}

.intro-section .content-wrapper,
.tutorial-section .content-wrapper,
.technical-section .content-wrapper,
.examples-section .content-wrapper,
.best-practices-section .content-wrapper,
.browser-support-section .content-wrapper {
    padding: 2rem;
}

section h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

section h3 {
    color: #34495e;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

section p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Tutorial steps */
.tutorial-steps {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    padding: 1.5rem;
    background: rgba(116, 75, 162, 0.1);
    border-radius: 12px;
    border-left: 4px solid #764ba2;
}

.step ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.step li {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Technical grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-item {
    padding: 1.5rem;
    background: rgba(103, 126, 234, 0.1);
    border-radius: 12px;
    border-top: 4px solid #667eea;
}

.tech-item code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Examples grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.example-item {
    padding: 1.5rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    border-bottom: 4px solid #3498db;
}

.code-snippet {
    margin-top: 1rem;
    padding: 1rem;
    background: #2c3e50;
    border-radius: 8px;
    overflow-x: auto;
}

.code-snippet code {
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Best practices */
.practices-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.practice-item {
    padding: 1.5rem;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 12px;
    border-right: 4px solid #2ecc71;
}

/* Browser support */
.browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.browser-item {
    padding: 1.5rem;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 12px;
    text-align: center;
    border-top: 4px solid #9b59b6;
}

.fallback-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(241, 196, 15, 0.1);
    border-radius: 12px;
    border-left: 4px solid #f1c40f;
}

/* Desktop layout with side ads */
.desktop-layout {
    display: flex;
    gap: 20px;
    flex: none;
    max-width: 1600px;
    margin: 2rem auto;
    width: calc(100% - 2rem);
}

/* Left and right ad spaces */
.ad-space-left,
.ad-space-right {
    width: 160px;
    min-height: 600px;
    flex-shrink: 0;
}

/* Content area (center column) */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.main-container {
    position: relative;
    width: 100%;
    height: 70vh;
    border-radius: 16px;
    background: url('image.jpg') center/cover no-repeat;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.container {
    position: absolute;
    width: fit-content;
    min-width: 300px;
    height: fit-content;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 28px;
    cursor: move;
    isolation: isolate;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    box-shadow: 0px 6px var(--outer-shadow-blur) rgba(0, 0, 0, 0.2);
    padding: 2rem;
}

.container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 28px;
    box-shadow:
        inset var(--shadow-offset) var(--shadow-offset) var(--shadow-blur) var(--shadow-spread) var(--shadow-color);
    background-color: rgba(var(--tint-color), var(--tint-opacity));
}

.container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 28px;
    -webkit-backdrop-filter: blur(var(--frost-blur));
    backdrop-filter: blur(var(--frost-blur));
    -webkit-filter: url("#glass-distortion");
    filter: url(#glass-distortion);
    isolation: isolate;
}

.container:active {
    transform: translate(-50%, -50%) scale(0.98);
}

.container .glass-text {
    margin: 0 auto;
    text-align: center;
    font-size: var(--initial-font-size);
    font-weight: bold;
    color: var(--initial-font-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-family: 'Arial', sans-serif;
    width: fit-content;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

/* Ad spaces - Side ads and banner ads */
.ad-space {
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-space .adsbygoogle {
    width: 100%;
    height: 100%;
    border: 2px dashed white;
}

/* Fallback styling for empty ad spaces during development */
.ad-space:empty {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

.ad-space:empty::before {
    content: "Ad Space";
    opacity: 0.5;
    color: rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

/* Banner ads between content sections */
.ad-banner-1,
.ad-banner-2,
.ad-banner-3 {
    min-height: 120px;
    margin: 2rem auto;
    max-width: 1200px;
    width: calc(100% - 2rem);
}

.controls-bar {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    z-index: 1000;
    font-size: 12px;
    min-height: 60px;
    flex-wrap: wrap;
    justify-content: space-around;
    border-radius: 16px;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 120px;
}

.control-group label {
    font-size: 10px;
    text-align: center;
    opacity: 0.8;
}

.control-group input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.control-group input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.control-group input[type="text"],
.control-group input[type="url"] {
    width: 120px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 5px 8px;
    font-size: 11px;
}

.control-group input[type="text"]::placeholder,
.control-group input[type="url"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.wide-input {
    min-width: 180px;
}

.export-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.export-btn:hover {
    transform: scale(1.05);
}

.value-display {
    font-size: 9px;
    opacity: 0.6;
    margin-top: 2px;
}

/* Footer */
.site-footer {
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
}

.site-footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
    color: white;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .desktop-layout {
        flex-direction: column;
    }
    
    /* Keep one ad above main container - use left ad */
    .ad-space-left {
        width: 100%;
        min-height: 100px;
        order: -1; /* Above main container */
    }
    
    .content-area {
        order: 0;
    }
    
    /* Hide the right ad completely in mobile within desktop-layout */
    .desktop-layout .ad-space-right {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    .content-wrapper {
        padding: 0 1rem;
    }
    
    section .content-wrapper {
        padding: 1.5rem;
    }
    
    .main-container {
        height: 50vh;
    }
    
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .control-group {
        min-width: auto;
        align-items: stretch;
    }
    
    .control-group label {
        text-align: left;
        margin-bottom: 5px;
    }
    
    .export-btn {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .tech-grid,
    .examples-grid,
    .practices-content,
    .browser-grid {
        grid-template-columns: 1fr;
    }
    
    .desktop-layout {
        margin: 1rem auto;
    }
    
    .ad-space-left {
        min-height: 100px;
    }
}

/* Tablet responsiveness */
@media (max-width: 1024px) and (min-width: 769px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .practices-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide right ad on tablets for better focus */
    .desktop-layout .ad-space-right {
        display: none !important;
    }
}