/* Edge Delivery Infrastructure Demo - Styles */

/* CSS Variables from Figma Design */
:root {
    /* Colors */
    --background-dark: #030506;
    --card-gradient-start: rgba(13, 36, 71, 1);
    --card-gradient-end: rgba(3, 14, 25, 1);
    --card-border: #0a2c4a;
    --text-white: #ffffff;
    --input-bg: #000000;
    --input-border: #182a5b;
    --button-bg: #64ebeb;
    --button-text: #10053d;
    
    /* Typography */
    --font-montserrat: 'Montserrat', sans-serif;
    --font-space-mono: 'Space Mono', monospace;
    
    /* Spacing */
    --card-border-radius: 16px;
    --input-border-radius: 4px;
    --button-border-radius: 3px;
    
    /* Shadows */
    --button-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.2);
    
    /* Error Colors */
    --error-bg: #ffd9cd;
    --error-input-border: #ff7459;
    --error-text: #000000;
    
    /* Progress Colors */
    --progress-cyan-100: #cbf8f8;
    --progress-cyan-200: #98f2f2;
    --progress-cyan-300: #64ebeb;
    --progress-cyan-600: #00bbbb;
    --progress-blue-400: #5a6bc7;
    --progress-blue-500: #303f90;
    --progress-blue-600: #30429a;
    --progress-blue-700: #8393eb;
    --progress-dark: #0e1d2a;
    
    /* Rectangle specific colors */
    --rectangle-71-bg: #303f90;
    --rectangle-79-bg: #98f2f2;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-montserrat);
    line-height: 1.6;
    color: var(--text-white);
    background: var(--background-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.demo-edge-app-form {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-dark);
}

/* Background Layers */
.background-layers {
    position: fixed;
    top: 1.38%;
    left: -1.95%;
    right: 0;
    bottom: 42.75%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.layer-1 {
    position: absolute;
    top: 0;
    bottom: 0;
    overflow: hidden;
}

.layer-left {
    left: 0;
    right: 51.56%;
}

.layer-right {
    left: 49.61%;
    right: 0;
}

.layer-1::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Background image - place background-layer.png in src/webapp/ directory */
    /* Note: If image doesn't exist, add background-layer.png to src/webapp/ */
    background-image: url('background-layer.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Main Card Container - Flexible positioning (not absolute like Figma) */
.main-card-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
    min-height: 500px;
    padding: 0 20px;
}

/* Main Card */
.main-card {
    position: relative;
    width: 100%;
    min-height: 100%;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Card Gradient Background */
.card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(125.0620820064943deg, var(--card-gradient-start) 3.2611%, var(--card-gradient-end) 98.814%);
    border: 1px solid var(--card-border);
    border-radius: var(--card-border-radius);
    z-index: 1;
}

/* Card Mask Image */
.card-mask {
    position: absolute;
    top: -8px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    z-index: 2;
    pointer-events: none;
    display: block;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    will-change: transform;
}

.mask-image {
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: var(--card-border-radius);
    transform: translateZ(0);
    backface-visibility: hidden;
    margin: -1px;
}

/* Logo Container */
.logo-container {
    position: relative;
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container .logo {
    font-family: var(--font-montserrat);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Demo Title and Description */
.demo-title {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 26px;
    line-height: 39px;
    color: var(--text-white);
    margin: 0 0 15px 0;
    text-align: center;
}

.demo-description {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
    margin: 0 0 30px 0;
    text-align: center;
    opacity: 1;
    padding: 0 70px;
}
.form-content {
    padding: 0 46px;
    text-align: left;
}
/* Card Content */
.card-content {
    position: relative;
    z-index: 3;
    padding: 40px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: none;
    outline: none;
}

/* Input Hint */
.input-hint {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    opacity: 0.8;
    margin-bottom: 12px;
    white-space: pre-wrap;
    text-align: left;
}

/* Input Container */
.input-container {
    margin-bottom: 20px;
}

/* URL Input */
.url-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-border-radius);
    padding: 12px 16px;
    font-family: var(--font-space-mono);
    font-weight: 400;
    font-size: 14px;
    line-height: normal;
    color: var(--text-white);
    opacity: 0.8;
    outline: none;
    caret-color: var(--text-white);
    transition: border-color 0.3s ease, opacity 0.3s ease;
    display: block;
}

.url-input:not(:placeholder-shown) {
    opacity: 0.8;
    caret-color: var(--text-white);
}

.url-input:focus {
    border-color: var(--button-bg);
    opacity: 1;
    background-color: var(--input-bg) !important;
    color: var(--text-white) !important;
    caret-color: var(--text-white);
}

.url-input:-webkit-autofill,
.url-input:-webkit-autofill:hover,
.url-input:-webkit-autofill:focus,
.url-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-white) !important;
    background-color: var(--input-bg) !important;
    color: var(--text-white) !important;
    caret-color: var(--text-white) !important;
}

.url-input::placeholder {
    color: var(--text-white);
    opacity: 0.5;
}

.url-input.invalid {
    border-color: var(--error-input-border) !important;
}

.url-input.invalid:focus {
    border-color: var(--error-input-border) !important;
}

/* Button Container */
.button-container {
    margin-bottom: 20px;
}

/* Mirror Button */
.mirror-button {
    background-color: var(--button-bg);
    border: none;
    border-radius: var(--button-border-radius);
    padding: 12px 16px;
    box-shadow: var(--button-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    text-decoration: none;
    text-transform: uppercase;
}

.mirror-button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
}

.mirror-button:active:not(:disabled) {
    transform: translateY(0);
}

.mirror-button:disabled {
    background: #6c757d;
    color: var(--text-white);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.button-text {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    color: var(--button-text);
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Footer Text */
.footer-text {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    opacity: 0.8;
    margin-top: 15px;
    white-space: pre-wrap;
    text-align: left;
}

/* Error message display */
.error-message {
    display: none;
    margin: 20px 0;
    padding: 20px 24px;
    border-radius: 8px;
    background-color: var(--error-bg);
    color: var(--error-text);
    border: none;
    animation: fadeIn 0.3s ease-in-out;
}

.error-message.show {
    display: block;
}

.error-message h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 16px 0;
    color: var(--error-text);
}

.error-message p {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 15px 0;
    color: var(--error-text);
}

.error-message p:last-child {
    margin-bottom: 0;
}

.error-message .error-suggestions {
    margin-top: 15px;
}

.error-message .error-suggestions h4 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 10px 0;
    color: var(--error-text);
}

.error-message .benefits-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.error-message .benefits-list li {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    padding: 0 0 12px 0;
    position: relative;
    padding-left: 32px;
    color: var(--error-text);
    display: flex;
    align-items: flex-start;
}

.error-message .benefits-list li:last-child {
    padding-bottom: 0;
}

.error-message .benefits-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" fill="%23000"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.error-message .retry-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 10px 20px;
    border: none;
    border-radius: var(--button-border-radius);
    box-shadow: var(--button-shadow);
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-message .retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
}

/* Error message state already updated above */

/* Form help text */
.form-help {
    display: block;
    margin-top: 5px;
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    opacity: 0.8;
    font-style: normal;
}

/* Keep label hidden for accessibility but not displayed */
label {
    display: none;
}

/* Fallback styles for any input[type="url"] not using .url-input class */
input[type="url"]:not(.url-input) {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: var(--input-border-radius);
    font-family: var(--font-space-mono);
    font-weight: 400;
    font-size: 14px;
    line-height: normal;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-white);
    opacity: 0.8;
    margin-bottom: 10px;
    outline: none;
}

input[type="url"]:not(.url-input)::placeholder {
    color: var(--text-white);
    opacity: 0.5;
}

input[type="url"]:not(.url-input):focus {
    border-color: var(--button-bg);
    opacity: 1;
    background-color: var(--input-bg) !important;
    color: var(--text-white) !important;
    caret-color: var(--text-white);
    box-shadow: 0 0 0 2px rgba(100, 235, 235, 0.2);
}

/* Fallback styles for any button not using .mirror-button class */
button:not(.mirror-button):not(.retry-btn):not(.access-btn):not(.copy-url-button) {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 12px 16px;
    border: none;
    border-radius: var(--button-border-radius);
    box-shadow: var(--button-shadow);
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:not(.mirror-button):not(.retry-btn):not(.access-btn):hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
}

button:not(.mirror-button):not(.retry-btn):not(.access-btn):active:not(:disabled) {
    transform: translateY(0);
}

button:not(.mirror-button):not(.retry-btn):not(.access-btn):disabled {
    background: #6c757d;
    color: var(--text-white);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress tracking */
.progress-container {
    display: none;
    background-color: var(--rectangle-71-bg);
    border-radius: 8px;
    padding: 21px 22px;
    margin: 20px 0;
    width: 100%;
    max-width: 612px;
    box-sizing: border-box;
    max-width: 100%;
}

.progress-container.show {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.progress-header {
    margin-bottom: 24px;
}

.progress-container h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 20px;
    line-height: 30px;
    margin: 0 0 16px 0;
    color: var(--text-white);
}

.progress-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-bar {
    flex: 1;
    height: 15px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--progress-dark);
    border-radius: 15px;
}

.progress-fill {
    height: 100%;
    background-color: var(--progress-cyan-300);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    position: relative;
    z-index: 1;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

.progress-percentage {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
    min-width: 40px;
    text-align: right;
}

.connection-status {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    background-color: var(--progress-cyan-100) !important;
    color: var(--error-text) !important;
    border: none;
    width: fit-content;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10;
    width: 100%;
}

.connection-status.success {
    background-color: var(--progress-cyan-100);
    color: var(--error-text);
}

.connection-status.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--text-white);
}

.connection-status.warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: var(--text-white);
}

.connection-status.info {
    background-color: var(--progress-cyan-100);
    color: var(--error-text);
}

.status-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.status-message {
    flex: 1;
}

.progress-steps {
    display: grid;
    gap: 0;
    margin-bottom: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    background-color: var(--progress-blue-400);
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    position: relative;
}

.step:last-child {
    margin-bottom: 0;
}

.step::before {
    display: none;
}

.step.pending {
    background-color: var(--progress-blue-400);
    opacity: 1;
}

/* Active step: cyan background with darker text for readability */
.step.step-active {
    background-color: var(--rectangle-79-bg);
    opacity: 1;
}

.step.step-active .step-title,
.step.step-active .step-label {
    color: var(--error-text);
}

.step.step-active .step-description {
    color: var(--error-text);
    opacity: 1;
}

/* Completed step: back to original blue background (only active step shows cyan) */
.step.step-completed {
    background-color: var(--progress-blue-400);
    opacity: 1;
}

.step.step-completed .step-title,
.step.step-completed .step-label {
    color: var(--text-white);
}

.step.step-completed .step-description {
    color: var(--text-white);
    opacity: 0.8;
}

/* Legacy support for 'complete' and 'active' classes */
.step.complete {
    background-color: var(--progress-blue-400);
    opacity: 1;
}

.step.complete .step-title,
.step.complete .step-label {
    color: var(--text-white);
}

.step.complete .step-description {
    color: var(--text-white);
    opacity: 0.8;
}

.step.active {
    background-color: var(--rectangle-79-bg);
    opacity: 1;
}

.step.active .step-title,
.step.active .step-label {
    color: var(--error-text);
}

.step.active .step-description {
    color: var(--error-text);
    opacity: 1;
}

.step.error {
    background-color: rgba(220, 53, 69, 0.2);
    opacity: 1;
}

.step-icon {
    font-size: 20px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.step.step-active .step-icon,
.step.active .step-icon {
    transform: scale(1.1);
}

.step-content {
    flex: 1;
}

.step-title {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 18px;
    line-height: 29px;
    margin-bottom: 4px;
    color: var(--text-white);
}

/* Legacy support for step-label */
.step-label {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 18px;
    line-height: 29px;
    margin-bottom: 4px;
    color: var(--text-white);
}

.step-description {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    opacity: 0.8;
}

.step-status {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-status-pending {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.step-status-completed {
    background-color: var(--progress-cyan-100);
    border: none;
}

.step-status-completed::after {
    content: '';
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" fill="%23000"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Active step status (uses pending style - empty circle with pulse animation) */
.step.step-active .step-status-pending,
.step.active .step-status-pending {
    animation: pulse 2s infinite;
}

/* Error step status */
.step.error .step-status {
    background-color: #dc3545;
    border: none;
    color: var(--text-white);
}

.progress-details {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none!important;
}

.details {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    opacity: 0.8;
    display: none!important;
}

.detail-item {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 13px;
    line-height: 23px;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: var(--progress-blue-700);
    border-radius: 4px;
    border: none;
    color: var(--text-white);
    display: none!important;
}

.detail-item strong {
    color: var(--text-white);
    font-weight: 600;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-card-container {
        max-width: 90%;
    }
    
    .progress-container {
        max-width: 100%;
    }
    
    .result {
        max-width: 100%;
    }
}

@media (max-width: 968px) {
    .demo-title {
        font-size: 22px;
        line-height: 32px;
    }
    
    .demo-description {
        font-size: 14px;
        line-height: 22px;
    }
    
    .card-content {
        padding: 4% 3.5%;
    }
}

@media (max-width: 768px) {
    .progress-container {
        padding: 20px;
        margin: 16px 0;
    }
    
    .progress-summary {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .progress-percentage {
        text-align: center;
        font-size: 16px;
    }
    
    .progress-container h3 {
        font-size: 18px;
        line-height: 26px;
    }
    
    .step {
        padding: 12px 14px;
    }
    
    .step-icon {
        font-size: 18px;
        width: 22px;
        height: 22px;
    }
    
    .step-title,
    .step-label {
        font-size: 16px;
        line-height: 24px;
    }
    
    .step-description {
        font-size: 13px;
        line-height: 20px;
    }
    
    .step-status {
        width: 22px;
        height: 22px;
    }
    
    .demo-title {
        font-size: 20px;
        line-height: 28px;
        margin-bottom: 6%;
    }
    
    .demo-description {
        font-size: 13px;
        line-height: 20px;
        margin-bottom: 12%;
    }
    
    .form-help {
        font-size: 12px;
        line-height: 18px;
    }
    
    .url-input {
        font-size: 13px;
        padding: 12px 8px;
    }
    
    .button-text {
        font-size: 13px;
    }
    
    .card-content {
        padding: 5% 4%;
    }
}

@media (max-width: 480px) {
    .progress-container {
        padding: 16px;
    }
    
    .progress-container h3 {
        font-size: 16px;
        line-height: 24px;
    }
    
    .step {
        padding: 12px;
    }
    
    .step-icon {
        font-size: 18px;
        width: 22px;
        height: 22px;
    }
    
    .step-title,
    .step-label {
        font-size: 14px;
        line-height: 22px;
    }
    
    .step-description {
        font-size: 12px;
        line-height: 18px;
    }
    
    .step-status {
        width: 22px;
        height: 22px;
    }
    
    .resource-count,
    .resource-time {
        font-size: 14px;
    }
    
    .detail-item {
        font-size: 12px;
    }
    
    .demo-title {
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 8%;
    }
    
    .demo-description {
        font-size: 12px;
        line-height: 18px;
        margin-bottom: 10%;
    }
    
    .form-help {
        font-size: 11px;
        line-height: 16px;
    }
    
    .url-input {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .mirror-button {
        padding: 10px 14px;
    }
    
    .button-text {
        font-size: 12px;
    }
    
    .card-content {
        padding: 6% 5%;
    }
    
    /* Hide background layers on very small screens for performance */
    .background-layers {
        display: none;
    }
}

/* Loading state */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
    background-color: transparent;
    border-radius: 8px;
    margin-top: 20px;
}

.loading.show {
    display: block;
}

.loading p {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
}

/* Result states */
.result {
    margin-top: 30px;
    padding: 21px 22px;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    background-color: var(--rectangle-71-bg);
    width: 100%;
    max-width: 612px;
    box-sizing: border-box;
}

.result.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 20px;
    line-height: 30px;
    margin: 0 0 15px 0;
    color: var(--text-white);
    text-align: left;
}

.result p {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    margin: 0 0 15px 0;
    color: var(--text-white);
    text-align: center;
}

.result p:last-child {
    margin-bottom: 0;
}

/* Success state */
.success {
    background-color: transparent;
    color: var(--text-white);
    border: none;
    border-radius: 0;
    padding: 0;
    text-align: center;
    position: relative;
    max-width: 100%;
    /* edw */
    background-color: var(--rectangle-71-bg);
    border-radius: 8px;
    padding: 21px 22px;
    margin: 20px 0;
    width: 100%;
    max-width: 612px;
    box-sizing: border-box;
    max-width: 100%;
}

.success-checkmark {
    position: relative;
    width: 156.64px;
    height: 89.76px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkmark-circle {
    display: none;
}

.checkmark-icon {
    font-size: 3.5rem;
    color: var(--text-white);
    font-weight: bold;
}

/* Sparkle animation for success state */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.success-checkmark .sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: sparkle 2s infinite;
    z-index: 3;
}

.success-checkmark .sparkle-1 {
    top: 10px;
    left: 20%;
    animation-delay: 0s;
}

.success-checkmark .sparkle-2 {
    top: 30px;
    right: 20%;
    animation-delay: 0.3s;
}

.success-checkmark .sparkle-3 {
    bottom: 30px;
    left: 25%;
    animation-delay: 0.6s;
}

.success-checkmark .sparkle-4 {
    bottom: 10px;
    right: 25%;
    animation-delay: 0.9s;
}

.success h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 20px;
    line-height: 30px;
    color: var(--text-white);
    margin-top: 0;
    margin-bottom: 12px;
}

.success h4 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
}

/* Error state */
.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: none;
    border-radius: 8px;
}

.error h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: var(--error-text);
}

.error p {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    color: var(--error-text);
}

/* Warning state */
.warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: var(--text-white);
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.warning h3 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    color: var(--text-white);
}

/* URL display */
.url-display {
    font-family: var(--font-space-mono);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    background-color: var(--progress-cyan-600);
    padding: 7px 16px;
    border-radius: 4px;
    margin: 12px 0;
    word-break: break-all;
    color: var(--text-white);
    border: none;
}

/* Warning list */
.warning-list {
    margin: 15px 0;
    padding: 0;
    list-style: none;
}

.warning-list h4 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
    margin-bottom: 10px;
}

.warning-list li {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.warning-list li:last-child {
    border-bottom: none;
}

.warning-list li::before {
    content: "⚠️ ";
    margin-right: 8px;
}

/* Access button */
.access-btn {
    display: inline-block;
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 12px 16px;
    text-decoration: none;
    border-radius: var(--button-border-radius);
    box-shadow: var(--button-shadow);
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    margin: 20px 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.access-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: var(--button-text);
}

/* Cache info styling */
.cache-info {
    background-color: var(--progress-cyan-100);
    border: none;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 0 0 30px 0;
    width: 100%;
    box-sizing: border-box;
}

.cache-info h4 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 18px;
    line-height: 29px;
    margin: 0 0 12px 0;
    color: var(--error-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cache-info p {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    margin: 8px 0;
    color: var(--error-text);
}

.cache-info strong {
    font-family: var(--font-montserrat);
    font-weight: 600;
    color: var(--error-text);
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    padding: 0 0 12px 0;
    position: relative;
    padding-left: 32px;
    color: var(--text-white);
    display: flex;
    align-items: flex-start;
}

.benefits-list li:last-child {
    padding-bottom: 0;
}

.benefits-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" fill="%23ffffff"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.benefits-section h4 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 16px 0;
    color: var(--text-white);
}

/* Retry button */
.retry-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 10px 20px;
    border: none;
    border-radius: var(--button-border-radius);
    box-shadow: var(--button-shadow);
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
}


/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
/* button:focus,
input:focus,
.access-btn:focus {
    outline: 1px solid var(--button-bg);
} */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .main-card {
        border: 2px solid var(--text-white);
    }
    
    button {
        border: 2px solid var(--button-text);
    }
    
    input[type="url"] {
        border: 2px solid var(--text-white);
    }
    
    .error-section {
        border: 2px solid var(--error-text);
    }
}

/* Resource Progress Display */
.resource-progress {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    margin-bottom: 0;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.resource-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-family: var(--font-montserrat);
}

.resource-count {
    font-weight: 600;
    font-size: 16px;
    line-height: 23px;
    color: var(--text-white);
}

.resource-percent {
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--progress-cyan-600);
    background-color: var(--progress-cyan-100);
    padding: 2px 8px;
    border-radius: 16px;
    opacity: 0.9;
}

.elapsed-time {
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
    margin-left: auto;
}

.resource-bar {
    width: 100%;
    height: 15px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 16px;
}

.resource-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--progress-dark);
    border-radius: 15px;
}

.resource-fill {
    height: 100%;
    background-color: var(--progress-cyan-300);
    border-radius: 15px;
    transition: width 0.3s ease;
    position: relative;
    z-index: 1;
}

.resource-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive adjustments for resource progress */
@media (max-width: 600px) {
    .resource-stats {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .resource-stats span {
        display: block;
    }
}

/* Spinner Animation */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #4dd0e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alternative: Animated dots */
.dots {
    display: inline-block;
    margin-right: 8px;
}

.dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Completed step styling */
.step.complete .step-description {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.step.complete .step-description::before {
    content: '✓ ';
    color: #28a745;
    font-weight: bold;
    margin-right: 4px;
}

/* Success Section */
.success-section {
    text-align: center;
    margin: 0 0 30px 0;
    padding: 0;
}

.success-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.success-icon-wrapper .success-checkmark {
    margin: 0;
}

.success-icon-image {
    width: 156.64px;
    height: 89.76px;
    object-fit: contain;
}

.success-title {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 20px;
    line-height: 30px;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 12px;
}

.success-description {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 30px;
}

/* Freshly Mirrored Section */
.freshly-mirrored-section {
    background-color: var(--progress-cyan-100);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 0 0 30px 0;
    width: 100%;
    box-sizing: border-box;
}

.freshly-mirrored-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.new-badge {
    background-color: #e0e0e0;
    color: #333333;
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.freshly-icon {
    font-size: 20px;
    line-height: 1;
}

.freshly-title {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 18px;
    line-height: 29px;
    color: #000000;
}

.freshly-description {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: #000000!important;
    margin-bottom: 8px;
}

.freshly-timestamp {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: #000000;
    margin-bottom: 12px;
}

.timestamp-label {
    font-family: var(--font-montserrat);
    font-weight: 600;
    color: #000000;
}

.timestamp-value {
    font-family: var(--font-montserrat);
    font-weight: 400;
    color: #000000;
}

.mirrored-url-container {
    background-color: var(--progress-cyan-600);
    border-radius: 4px;
    padding: 7px 16px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mirrored-url {
    font-family: var(--font-space-mono);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    text-decoration: none;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.mirrored-url:hover {
    text-decoration: underline;
}

.copy-url-button {
    background-color: var(--progress-cyan-100);
    border: 1px solid var(--progress-cyan-300);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    color: #000000;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 13px;
    line-height: 18px;
}

.copy-url-button:hover {
    background-color: var(--progress-cyan-200);
    border-color: var(--progress-cyan-600);
}

.copy-url-button:active {
    background-color: var(--progress-cyan-200);
    border-color: var(--progress-cyan-600);
}

.copy-url-button svg {
    stroke: #000000;
}

.copy-url-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.copy-url-text {
    white-space: nowrap;
}

/* Result Button Container */
.result-button-container {
    margin: 0 0 20px 0;
}

.open-website-button {
    width: 100%;
}

/* Mirror Another URL Link */
.mirror-another-container {
    text-align: center;
    margin: 0 0 30px 0;
}

.mirror-another-link {
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 14px;
    line-height: 23px;
    color: var(--text-white);
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.mirror-another-link:hover {
    opacity: 1;
}

/* Performance Benefits Section */
.performance-benefits-section {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.performance-benefits-title {
    font-family: var(--font-montserrat);
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
    margin-bottom: 16px;
}

.performance-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.performance-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-family: var(--font-montserrat);
    font-weight: 400;
    font-size: 16px;
    line-height: 26px;
    color: var(--text-white);
}

.performance-benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-checkmark {
    width: 13px;
    height: 10px;
    flex-shrink: 0;
    margin-top: 7px;
    object-fit: contain;
    display: inline-block;
}

.benefit-checkmark path {
    stroke: var(--progress-cyan-300, #64EBEB);
    stroke-width: 2px;
}

/* Responsive adjustments for result section */
@media (max-width: 768px) {       
    .freshly-mirrored-section {
        padding: 14px 16px;
    }
    
    .performance-benefits-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .freshly-mirrored-section {
        padding: 12px 14px;
    }
    
    .freshly-title {
        font-size: 16px;
        line-height: 24px;
    }
    
    .freshly-description,
    .freshly-timestamp {
        font-size: 13px;
        line-height: 20px;
    }
    
    .performance-benefits-section {
        padding: 14px;
    }
    
    .performance-benefits-title {
        font-size: 14px;
        line-height: 22px;
    }
    
    .performance-benefit-item {
        font-size: 14px;
        line-height: 22px;
    }
    
    .mirrored-url-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-url-button {
        width: 100%;
        justify-content: center;
    }
}
