:root {
    --bg-color: #0d0e15;
    --text-color: #e2e8f0;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #1e293b;
    --secondary-hover: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Background Animations */
.background-orbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #3b82f6;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: #ec4899;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

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

/* Main Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    justify-content: center;
}

#tender-id {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    font-size: 1.2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

#tender-id:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn.primary {
    background: var(--primary);
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
}

.btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.23);
}

.btn.secondary {
    background: var(--secondary);
    border: 1px solid var(--glass-border);
}

.btn.secondary:hover {
    background: var(--secondary-hover);
}

/* Results Section */
.result-section {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.hidden {
    display: none !important;
}

/* Loader and Progress */
#loader-container {
    text-align: center;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(139, 92, 246, 0.2);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin-bottom: 16px;
}

.progress-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    animation: pulse 1.5s infinite ease-in-out;
    background: rgba(15, 23, 42, 0.6);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(0.98); }
}

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

.error-msg {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

/* Syntax Highlighted JSON */
.json-result {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    color: #cbd5e1;
    max-height: 500px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
    padding-top: 32px;
}

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

.json-result::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.json-result::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 4px;
}
.json-result::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}
.json-result::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.string { color: #a78bfa; }
.number { color: #f472b6; }
.boolean { color: #38bdf8; }
.null { color: #94a3b8; }
.key { color: #fbbf24; font-weight: 600; }

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.copy-btn.copied:hover {
    background: #10b981;
    color: white;
}
