/* Large Green Start Widget - Fixed version */
#config-init .widgets .start-widget {
    background: linear-gradient(135deg, #0a8f72 0%, #10b981 50%, #34d399 100%);
    color: white;
    border: 5px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    padding: 55px 45px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.5);
    position: relative;
    overflow: hidden;
}

.start-widget:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 30px 60px rgba(16, 185, 129, 0.65);
    border-color: rgba(255, 255, 255, 0.85);
}

.start-widget:active {
    transform: scale(0.97);
}

/* Ensure children do NOT cover the background */
.start-widget > * {
    background: transparent !important;   /* This is the key fix */
    position: relative;
    z-index: 2;
}

/* Icon */
.start-widget .widget-icon {
    font-size: 6rem;
    line-height: 1;
    margin-bottom: 20px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

/* Title */
.start-widget .widget-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Subtitle */
.start-widget .widget-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.95;
}

/* Small screen adjustment */
@media (max-width: 600px) {
    .start-widget {
        max-width: 340px;
        padding: 45px 35px;
    }
    
    .start-widget .widget-icon {
        font-size: 5rem;
    }
    
    .start-widget .widget-title {
        font-size: 2.2rem;
    }
}
#config-init {
    /* Responsive, window-aware sizing */
    width: 85%;
    max-width: 820px;
    min-width: 320px;           /* Prevents it from becoming too narrow on mobile */
    
    /* Height is now viewport-dependent */
    min-height: 65vh;           /* Takes up a good portion of the screen height */
    max-height: 85vh;           /* Never exceeds 85% of viewport height */
    
    margin: 30px auto;          /* Centered with breathing room at top/bottom */
    
    /* Keep card appearance */
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
    border: 1px solid #e0e0e0;
    overflow: hidden;           /* Prevents content from breaking the shape */
    
    /* Flex layout for perfect centering */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    
    /* Padding that scales reasonably */
    padding: 40px 35px;
}

/* Title and subtitle */
#config-init h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);   /* Scales nicely with screen size */
    color: #667eea;
    text-align: center;
    margin: 0 0 10px 0;
    font-weight: 700;
    line-height: 1.1;
}

#config-init p {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: #555;
    text-align: center;
    margin: 0;
    max-width: 85%;
    line-height: 1.5;
}

/* Container for your selectable widget images */
#config-init .widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
}

/* Individual selectable widgets */
#config-init .widget {
    background: #f8f9fa;
    border: 3px solid transparent;
    border-radius: 14px;
    padding: 20px 16px;
    width: 170px;
    max-width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#config-init .widget:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

#config-init .widget.selected {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.18);
}

/* Make sure it doesn't cause page scroll on smaller windows */
@media (max-height: 700px) {
    #config-init {
        min-height: 75vh;
        padding: 30px 25px;
        gap: 24px;
    }
    
    #config-init h2 {
        font-size: 1.9rem;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #667eea;
    min-height: 100vh;
    color: #333;
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #667eea;
    color: white;
}

.dev-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-size: 0.85em;
}

.dev-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.dev-toggle label {
    cursor: pointer;
    user-select: none;
    color: #667eea;
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0d7a72 0%, #2dd469 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d12a3d 0%, #e04a35 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

#status,
#bugStatus {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    min-height: 50px;
    font-size: 0.95em;
    line-height: 1.6;
}

#status:empty::before {
    content: "Ready...";
    color: #999;
}

.status-info    { border-left-color: #17a2b8; background: #d1ecf1; color: #0c5460; }
.status-success { border-left-color: #28a745; background: #d4edda; color: #155724; }
.status-error   { border-left-color: #dc3545; background: #f8d7da; color: #721c24; }
.status-warning { border-left-color: #ffc107; background: #fff3cd; color: #856404; }

/* Terminal Styles */
#terminal {
    background-color: #000;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    padding: 20px;
}

#terminal h2 {
    color: #00ff00;
    border-bottom: 2px solid #00ff00;
}

.terminal-body {
    background-color: #000;
    height: 300px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #333;
    margin-bottom: 15px;
    white-space: pre;
    font-size: 0.9em;
    line-height: 1.4;
}

.terminal-input-container {
    display: flex;
    gap: 10px;
}

#terminalInput {
    background: #000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
}

#terminalInput::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.btn-terminal {
    background: #00ff00;
    color: #000;
    box-shadow: none;
}

.btn-terminal:hover {
    background: #00cc00;
    color: #000;
}

.esp-tools-section {
    margin-top: 20px;
}

esp-web-install-button {
    display: block;
    margin-top: 15px;
}

.icon {
    display: inline-block;
    margin-right: 8px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .dev-toggle {
        margin-left: 0;
        justify-content: center;
    }

    .header h1 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    button,
    input[type="text"] {
        width: 100%;
    }
}
