:root {
    --bg-primary: #010714;
    --bg-secondary: #020b1a;
    --bg-card: #0c1b33;
    --bg-card-hover: #132744;
    --border-color: #2a4366;
    --accent-cyan: #00d8ff;
    --accent-blue: #0088ff;
    --text-primary: #ffffff;
    --text-secondary: #7ebcff;
    --text-tertiary: #5e8ec7;
    --gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    background-image: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background effects */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 50% 30%, rgba(0, 216, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Neo Circuit Lines */
.circuit-lines {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.1;
}

.circuit-line {
    position: absolute;
    background: var(--accent-cyan);
    opacity: 0.3;
}

.circuit-line.h1 {
    height: 1px;
    width: 30%;
    top: 20%;
    left: 5%;
}

.circuit-line.h2 {
    height: 1px;
    width: 20%;
    top: 40%;
    right: 10%;
}

.circuit-line.v1 {
    width: 1px;
    height: 25%;
    top: 20%;
    left: 35%;
}

.circuit-line.v2 {
    width: 1px;
    height: 35%;
    bottom: 10%;
    right: 30%;
}

.circuit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 5px var(--accent-cyan);
}

.circuit-dot.d1 {
    top: 20%;
    left: 35%;
    animation: pulse 3s infinite;
}

.circuit-dot.d2 {
    top: 40%;
    right: 10%;
    animation: pulse 4s infinite 1s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 35%;
    background: var(--gradient);
}

/* Scanner line effect */
.scanner-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-cyan);
    opacity: 0.3;
    animation: scanner 3s linear infinite;
    pointer-events: none;
}

@keyframes scanner {
    0% { top: 0; }
    100% { top: 100%; }
}

header {
    background: var(--gradient);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -150px;
    left: -150px;
    width: 300px;
    height: 300px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

header::after {
    content: '';
    position: absolute;
    bottom: -150px;
    right: -150px;
    width: 300px;
    height: 300px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.tab-button:hover {
    background: var(--bg-card-hover);
    color: var(--accent-cyan);
}

.tab-button.active {
    background: var(--bg-card);
    color: var(--accent-cyan);
    border-bottom: 3px solid var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 216, 255, 0.2);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.tab-button:hover::after {
    width: 100%;
}

.tab-content {
    display: none;
    padding: 40px;
    background: var(--bg-card);
    position: relative;
}

.tab-content.active {
    display: block;
}

.form-section {
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -40px;
    width: 5px;
    height: 100%;
    background: var(--gradient);
    opacity: 0.7;
}

.form-section h2 {
    color: var(--accent-cyan);
    margin-bottom: 30px;
    font-size: 1.8em;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    position: relative;
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.1em;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea, select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 216, 255, 0.3);
    background: var(--bg-card-hover);
}

textarea::placeholder {
    color: var(--text-tertiary);
}

textarea {
    min-height: 120px;
    line-height: 1.6;
}

select {
    height: 50px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2300d8ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.generate-btn {
    background: var(--gradient);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 250px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.generate-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;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 216, 255, 0.5);
}

.generate-btn:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    margin: 20px;
    border-radius: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.1em;
    color: #6c757d;
}

.result-container {
    background: var(--bg-secondary);
    padding: 30px;
    margin: 20px 0;
    border-radius: 15px;
    border: 1px solid rgba(0, 216, 255, 0.2);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.result-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 15px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

.result-container h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 216, 255, 0.3);
}

#result-content {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-cyan);
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 1em;
    color: var(--text-primary);
    max-height: 500px;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

#result-content::-webkit-scrollbar {
    width: 8px;
}

#result-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

#result-content::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 4px;
}

#result-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

#result-content::selection {
    background: rgba(0, 216, 255, 0.3);
}

.result-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.copy-btn, .clear-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.copy-btn {
    background: linear-gradient(135deg, #00d8ff, #0099cc);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 216, 255, 0.3);
}

.copy-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;
}

.copy-btn:hover::before {
    left: 100%;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 216, 255, 0.5);
}

.clear-btn {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 216, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.clear-btn:hover {
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 216, 255, 0.2);
}

.error {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 59, 48, 0.05) 100%);
    color: #ff6b6b;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-left: 4px solid #ff3b30;
    margin: 20px 0;
    box-shadow: 
        0 10px 40px rgba(255, 59, 48, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.success {
    background: linear-gradient(135deg, rgba(0, 216, 255, 0.1) 0%, rgba(0, 216, 255, 0.05) 100%);
    color: var(--accent-cyan);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(0, 216, 255, 0.3);
    border-left: 4px solid var(--accent-cyan);
    margin: 20px 0;
    box-shadow: 
        0 10px 40px rgba(0, 216, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .tab-button {
        text-align: center;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab-button:first-child {
        border-radius: 10px 10px 0 0;
    }
    
    .tab-button:last-child {
        border-radius: 0 0 10px 10px;
        border-bottom: none;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .copy-btn, .clear-btn {
        width: 100%;
    }
    
    .result-container {
        margin: 15px 0;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .form-section h2 {
        font-size: 1.3em;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    input, textarea, select {
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    #result-content {
        max-height: 300px;
    }
}
