/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

/* Main Container */
.embed-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Demo Section - Side by Side Layout */
.demo-section {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px 0;
}

/* House Display */
.house-display {
    position: relative;
    flex: 1;
    max-width: 600px;
    min-width: 300px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.house-display img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 20px 20px;
}

.current-color-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#colorName {
    color: #00d9ff;
    font-weight: 700;
}

/* Phone Mockup */
.phone-mockup {
    flex-shrink: 0;
}

.phone-frame {
    width: 300px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 45px;
    padding: 12px;
    box-shadow: 
        0 0 0 2px #404040,
        0 0 0 5px #1a1a1a,
        0 25px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.phone-notch {
    width: 120px;
    height: 28px;
    background: #000;
    margin: 0 auto 0;
    border-radius: 0 0 18px 18px;
    position: relative;
    z-index: 10;
}

.phone-notch::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
    top: 8px;
    right: 25px;
}

.phone-screen {
    background: linear-gradient(180deg, #1c1c24 0%, #12121a 100%);
    border-radius: 35px;
    padding: 0;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* App Header */
.app-header {
    padding: 0 15px 15px;
    background: linear-gradient(180deg, rgba(0, 217, 255, 0.1) 0%, transparent 100%);
}

.app-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    font-size: 0.75rem;
    color: #fff;
}

.status-time {
    font-weight: 600;
}

.status-icons {
    display: flex;
    gap: 5px;
}

.status-icon {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.controller-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    padding-top: 5px;
}

.title-icon {
    width: 24px;
    height: 24px;
    color: #00d9ff;
}

/* Color Button Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 15px;
    flex: 1;
    align-content: start;
}

.color-btn {
    position: relative;
    height: 58px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.color-btn .btn-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.85;
    border-radius: 12px;
}

.color-btn .btn-icon {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.color-btn .color-label {
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-btn:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.color-btn.active {
    border-color: #00d9ff;
    box-shadow: 
        0 0 0 2px rgba(0, 217, 255, 0.3),
        0 8px 30px rgba(0, 217, 255, 0.3);
}

.color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #00d9ff;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    z-index: 3;
}

/* Rainbow button special styling */
.rainbow-gradient {
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000) !important;
    background-size: 200% 100% !important;
    animation: rainbow-shift 3s linear infinite;
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* App Footer */
.app-footer {
    padding: 15px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Proceed Button */
.proceed-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #00d9ff 0%, #0088cc 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    position: relative;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 35px rgba(0, 217, 255, 0.6), 0 0 50px rgba(0, 217, 255, 0.3);
        transform: scale(1.02);
    }
}

.proceed-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #00d9ff, #0088cc, #00d9ff);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.proceed-btn:hover {
    background: linear-gradient(135deg, #00eaff 0%, #00aadd 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.5);
    animation: none;
}

.proceed-btn:hover::before {
    animation: none;
    opacity: 0;
}

.proceed-btn:active {
    transform: translateY(0) scale(0.98);
}

.proceed-icon {
    width: 22px;
    height: 22px;
}

/* Home Indicator */
.home-indicator {
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 15px auto 10px;
}

/* Responsive Design */
@media (max-width: 900px) {
    .demo-section {
        flex-direction: column;
    }

    .house-display {
        max-width: 100%;
    }

    .phone-frame {
        width: 280px;
    }
}

@media (max-width: 500px) {
    .embed-container {
        padding: 10px;
    }

    .phone-frame {
        width: 260px;
    }

    .phone-screen {
        min-height: 480px;
    }

    .color-btn {
        height: 45px;
    }
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Widget Overlay Styles */
.widget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget-overlay.active {
    display: block;
    opacity: 1;
}

.widget-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.widget-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 750px;
    height: 90%;
    max-height: 800px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: widgetSlideIn 0.3s ease;
}

@keyframes widgetSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.widget-close {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.widget-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 600px) {
    .widget-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .widget-close {
        top: 5px;
        right: 10px;
    }
}
