:root {
    --bg-color: #0d0a14;
    --panel-bg: rgba(26, 20, 35, 0.7);
    --border-color: rgba(200, 150, 46, 0.3);
    --border-hover: rgba(200, 150, 46, 0.8);
    --accent: #c8962e;
    --accent-glow: rgba(200, 150, 46, 0.5);
    --text-primary: #f0e6d2;
    --text-secondary: #a09582;
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Dynamic Animated Background */
.background-animation {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(200, 150, 46, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.05) 0%, transparent 40%);
    animation: rotateBg 60s linear infinite;
    z-index: 0;
}

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

.container {
    width: 100%;
    max-width: 600px;
    z-index: 10;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.logo-hex {
    width: 48px;
    height: 48px;
    background: var(--accent);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #111;
    box-shadow: 0 0 20px var(--accent-glow);
    animation: pulseLogo 3s infinite alternate;
}

@keyframes pulseLogo {
    0% { filter: drop-shadow(0 0 5px var(--accent-glow)); transform: scale(1); }
    100% { filter: drop-shadow(0 0 15px var(--accent)); transform: scale(1.05); }
}

.header-text h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(200, 150, 46, 0.3);
}

.header-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Upload Panel (Glassmorphism) */
.upload-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.upload-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: rgba(200, 150, 46, 0.15);
    color: var(--accent);
    box-shadow: inset 0 0 10px rgba(200, 150, 46, 0.1);
}

/* Input Sections */
.input-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.input-section.active {
    display: block;
}

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

/* Drag & Drop Area */
.file-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.file-drop-area:hover, .file-drop-area.highlight {
    border-color: var(--accent);
    background: rgba(200, 150, 46, 0.05);
}

.file-drop-area.has-file {
    border-style: solid;
    border-color: var(--accent);
    background: rgba(200, 150, 46, 0.1);
}

.icon-cloud {
    font-size: 48px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(200, 150, 46, 0.3));
    transition: transform 0.3s ease;
}

.file-drop-area:hover .icon-cloud {
    transform: translateY(-5px);
}

.file-msg {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 10px;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
    word-break: break-all;
}

/* URL Input Area */
.url-input-area {
    padding: 20px 0;
}

.url-input-area label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.url-input-area input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input-area input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Submit Button */
.submit-area {
    margin-top: 30px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #e8b84b, #c8962e);
    color: #111;
    border: none;
    padding: 16px 40px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 5px 15px rgba(200, 150, 46, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 150, 46, 0.6);
}

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

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

/* Spinner */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(17, 17, 17, 0.3);
    border-top-color: #111;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    z-index: 1;
}

.btn-primary.loading .spinner {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 10, 20, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loader-content {
    text-align: center;
}

.loader-hex {
    font-size: 60px;
    color: var(--accent);
    animation: rotatePulse 2s infinite ease-in-out;
    margin-bottom: 20px;
}

@keyframes rotatePulse {
    0% { transform: rotate(0deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 1; filter: drop-shadow(0 0 20px var(--accent)); }
    100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}

.loader-content p {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    animation: blinkText 1.5s infinite;
}

@keyframes blinkText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
