/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #e8eaed;
}

/* Header Styles - Builder Theme */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #1a1a2e;
    padding: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 
                0 0 0 3px #ffd700,
                0 0 20px rgba(255, 215, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 4px solid #ffd700;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1.5rem;
}

.logo {
    height: 60px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background: white;
    padding: 4px;
}

.logo:hover {
    transform: scale(1.05) rotate(2deg);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: relative;
}

.header h1::after {
    content: "🔨";
    position: absolute;
    right: -40px;
    top: -5px;
    font-size: 1.5rem;
    animation: hammer 2s ease-in-out infinite;
}

@keyframes hammer {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.builder-subtitle {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Card Styles - Builder Workshop Theme */
.card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e32 100%);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 
                0 0 0 2px #ffd700,
                inset 0 1px 0 rgba(255,255,255,0.1);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,215,0,0.2);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ffd700, #ff6b35);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.card-header {
    margin-bottom: 2rem;
}

.card-header h2 {
    color: #ffd700;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    position: relative;
}

.card-header h2::before {
    content: "⚒️";
    margin-right: 0.5rem;
}

.card-header p {
    color: #b0b3b8;
    font-size: 1rem;
    line-height: 1.6;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffd700;
    font-size: 1rem;
}

select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #3a3a54;
    border-radius: 12px;
    font-size: 1rem;
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e32 100%);
    color: #e8eaed;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.2), 
                inset 0 2px 4px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #3a3a54 0%, #2a2a3e 100%);
}

/* Code Textarea - Workshop Style */
#codeInput {
    width: 100%;
    height: 320px;
    padding: 1.5rem;
    border: 2px solid #3a3a54;
    border-radius: 12px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e8eaed;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.6;
}

#codeInput:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.2), 
                inset 0 2px 8px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
}

#codeInput::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Button Styles - Builder Tools Theme */
.btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255,107,53,0.3), 
                0 0 0 2px rgba(255,107,53,0.1);
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255,107,53,0.4), 
                0 0 0 2px rgba(255,107,53,0.2);
    background: linear-gradient(135deg, #f7931e 0%, #ffd700 100%);
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    box-shadow: 0 6px 20px rgba(108,92,231,0.3), 
                0 0 0 2px rgba(108,92,231,0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    box-shadow: 0 12px 30px rgba(108,92,231,0.4), 
                0 0 0 2px rgba(108,92,231,0.2);
}

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    margin: 0;
}

/* Results Area */
.results {
    margin-top: 1.5rem;
    min-height: 100px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.results-success .results-icon {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    box-shadow: 0 0 10px rgba(0,184,148,0.3);
}

.results-error .results-icon {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    color: white;
    box-shadow: 0 0 10px rgba(225,112,85,0.3);
}

.results-warning .results-icon {
    background: linear-gradient(135deg, #fdcb6e 0%, #e84393 100%);
    color: white;
    box-shadow: 0 0 10px rgba(253,203,110,0.3);
}

/* Issue List - Workshop Notes Style */
.issue-list {
    list-style: none;
    padding: 0;
}

.issue-item {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e32 100%);
    border-left: 4px solid #ffd700;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 12px 12px 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.issue-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ffd700 0%, #ff6b35 50%, #f7931e 100%);
}

.issue-item.error {
    border-left-color: #e17055;
    background: linear-gradient(135deg, #3a2a2e 0%, #2e1e22 100%);
}

.issue-item.error::before {
    background: linear-gradient(180deg, #e17055 0%, #d63031 100%);
}

.issue-item.warning {
    border-left-color: #fdcb6e;
    background: linear-gradient(135deg, #3a352a 0%, #2e2a1e 100%);
}

.issue-item.warning::before {
    background: linear-gradient(180deg, #fdcb6e 0%, #e84393 100%);
}

.issue-meta {
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.issue-message {
    color: #e8eaed;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Auto-fix Results Section */
.autofix-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 3px solid #ffd700;
    position: relative;
}

.autofix-section::before {
    content: "🏗️ MASTER BUILDER RESULTS";
    position: absolute;
    top: -12px;
    left: 1rem;
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e32 100%);
    color: #ffd700;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    border: 2px solid #ffd700;
}

.fixed-code {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 3px solid #00b894;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
    color: #e8eaed;
    box-shadow: 0 8px 25px rgba(0,184,148,0.2), 
                inset 0 1px 0 rgba(255,255,255,0.1);
    line-height: 1.6;
}

.copy-all-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0,184,148,0.3);
}

.copy-all-btn:hover {
    background: linear-gradient(135deg, #00cec9 0%, #74b9ff 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,184,148,0.4);
}

.copy-all-btn.copied {
    background: linear-gradient(135deg, #ffd700 0%, #f7931e 100%);
    box-shadow: 0 4px 12px rgba(255,215,0,0.3);
}

/* Loading State - Construction Theme */
.loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffd700;
    font-weight: 600;
    padding: 2rem;
    justify-content: center;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #3a3a54;
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite, glow 2s ease-in-out infinite alternate;
}

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

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255,215,0,0.2); }
    100% { box-shadow: 0 0 20px rgba(255,215,0,0.6); }
}

/* Toast Notification - Builder Alert */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,184,148,0.3), 
                0 0 0 2px rgba(0,184,148,0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.2);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast::before {
    content: "🔧";
    margin-right: 0.5rem;
}

/* Responsive Design - Mobile Workshop */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header h1::after {
        right: -30px;
        font-size: 1.2rem;
    }

    .container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    #codeInput {
        height: 280px;
        font-size: 0.9rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .issue-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .logo {
        height: 50px;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }
}

/* Success Animation - Builder Celebration */
@keyframes checkmark {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.success-icon {
    animation: checkmark 0.8s ease-in-out;
}

/* Additional Builder Effects */
.results-title h3 {
    color: #ffd700;
    font-weight: 700;
}

.results h3 {
    color: #e8eaed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ffd700 0%, #ff6b35 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  }
