: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;
    }
}

/* Glass Examples Section */
.glass-examples-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);
}

.glass-examples-section .content-wrapper {
    padding: 2rem;
}

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

.example-container {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.example-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Copy Settings Button */
.copy-settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(103, 126, 234, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(103, 126, 234, 0.3);
    z-index: 10;
}

.copy-settings-btn:hover {
    background: rgba(103, 126, 234, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(103, 126, 234, 0.4);
}

.copy-settings-btn:active {
    transform: scale(0.95);
}

.copy-settings-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Copy button success state */
.copy-settings-btn.copied {
    background: rgba(46, 204, 113, 0.9);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.copy-settings-btn.copied:hover {
    background: rgba(46, 204, 113, 1);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    z-index: 10000;
    animation: slideInNotification 0.3s ease-out, fadeOutNotification 0.3s ease-in 2.7s forwards;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.example-container h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.background-demo {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    background: url('image.jpg') center/cover no-repeat;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Base glass example structure - same as main container */
.glass-example {
    position: relative;
    padding: 1.5rem;
    width: calc(90% - 3rem);
    border-radius: 20px;
    text-align: center;
    isolation: isolate;
    cursor: default;
}

.glass-example h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.glass-example p {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Example 1: Subtle Liquid Glass - Low distortion, soft blur */
.glass-card {
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.15);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 25px -8px rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.2);
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    -webkit-filter: url(#glass-subtle);
    filter: url(#glass-subtle);
    isolation: isolate;
}

/* Example 2: Heavy Frost Liquid Glass - High blur, medium distortion */
.glass-frosted {
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.2);
}

.glass-frosted::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 40px -5px rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.35);
}

.glass-frosted::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    -webkit-filter: url(#glass-frost);
    filter: url(#glass-frost);
    isolation: isolate;
}

/* Example 3: Tinted Liquid Glass - Colored with medium settings */
.glass-tinted {
    box-shadow: 0px 6px 25px rgba(103, 126, 234, 0.3);
}

.glass-tinted::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 30px -6px rgba(103, 126, 234, 0.7);
    background-color: rgba(103, 126, 234, 0.25);
}

.glass-tinted::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-filter: url(#glass-tinted);
    filter: url(#glass-tinted);
    isolation: isolate;
}

/* Example 4: Intense Liquid Bubble - High distortion, bubble shape */
.glass-bubble {
    border-radius: 50px;
    box-shadow: 
        0px 12px 40px rgba(0, 0, 0, 0.25),
        0px 0px 0px 2px rgba(255, 255, 255, 0.1);
}

.glass-bubble::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 50px;
    box-shadow: 
        inset 0 0 50px -10px rgba(255, 255, 255, 0.8),
        inset 0 0 20px 0px rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.15);
}

.glass-bubble::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 50px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    -webkit-filter: url(#glass-bubble);
    filter: url(#glass-bubble);
    isolation: isolate;
}

/* Example 5: Ultra Liquid Bar - Maximum distortion, gradient tint */
.glass-gradient {
    border-radius: 30px;
    height: -webkit-fit-content;
    height: fit-content;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0px 8px 35px rgba(0, 0, 0, 0.2);
    margin: 0 auto; /* Center the bar */
}

.glass-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 30px;
    box-shadow: 
        inset 0 0 35px -8px rgba(255, 255, 255, 0.9),
        inset 0 -10px 20px -10px rgba(138, 43, 226, 0.3),
        inset 0 10px 20px -10px rgba(255, 255, 255, 0.4);
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.4) 0%,
        rgba(138, 43, 226, 0.2) 50%,
        rgba(255, 255, 255, 0.3) 100%
    );
}

.glass-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 30px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    -webkit-filter: url(#glass-ultra);
    filter: url(#glass-ultra);
    isolation: isolate;
}

/* Responsive adjustments for examples */
@media (max-width: 768px) {
    .examples-showcase {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .background-demo {
        height: 180px;
    }
    
    .glass-example {
        padding: 1rem;
    }
    
    .glass-gradient {
        width: 200px !important; /* Override inherited width on mobile */
        height: 50px;
        margin: 0 auto; /* Keep centered on mobile */
    }
    
    /* Mobile responsive for copy buttons */
    .copy-settings-btn {
        width: 35px;
        height: 35px;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .copy-settings-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Mobile notification */
    .copy-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 13px;
        padding: 10px 16px;
    }
    
    @keyframes slideInNotification {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes fadeOutNotification {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
}