/* ============================================
   Almas Data Fetcher - Premium Dark Theme
   Colors derived from Almas Logo
   ============================================ */

:root {
    /* Almas Brand Colors */
    --almas-blue: #5B9BD5;
    --almas-blue-light: #7BB3E0;
    --almas-blue-dark: #4A87C4;
    --almas-silver: #A8B5C4;
    --almas-silver-light: #C5CFD9;
    --almas-charcoal: #2C3E50;

    /* Background Colors */
    --bg-primary: #0a0d10;
    --bg-secondary: #0f1419;
    --bg-card: rgba(15, 20, 25, 0.9);
    --bg-glass: rgba(91, 155, 213, 0.03);

    /* Accent Gradient - Almas Blue to Silver */
    --accent-primary: var(--almas-blue);
    --accent-secondary: var(--almas-silver);
    --accent-gradient: linear-gradient(135deg, #5B9BD5 0%, #7BB3E0 50%, #A8B5C4 100%);
    --accent-gradient-horizontal: linear-gradient(90deg, #5B9BD5 0%, #A8B5C4 100%);

    /* Text Colors */
    --text-primary: #f0f4f8;
    --text-secondary: #a8b5c4;
    --text-muted: #6b7a8c;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: var(--almas-blue);

    /* Borders & Effects */
    --border-color: rgba(91, 155, 213, 0.15);
    --border-radius: 16px;
    --border-radius-sm: 10px;

    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(91, 155, 213, 0.15);
    --shadow-logo: 0 0 60px rgba(91, 155, 213, 0.3);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects - Almas Blue Theme */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 155, 213, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(168, 181, 196, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse 50% 30% at 10% 80%, rgba(91, 155, 213, 0.06) 0%, transparent 40%);
    z-index: -2;
}

.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 25s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--almas-blue);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--almas-silver);
    bottom: 10%;
    left: -5%;
    animation-delay: -8s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--almas-blue-light);
    top: 50%;
    left: 50%;
    animation-delay: -16s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(40px, 10px) scale(1.02);
    }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header with Logo */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Premium Circular Logo Container */
.logo-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rotating gradient border */
.logo-container::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            #1a1a1a,
            #2d2d2d,
            #404040,
            #2d2d2d,
            #1a1a1a);
    animation: rotate-border 4s linear infinite;
    z-index: 0;
}

/* Inner dark circle */
.logo-container::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--bg-primary);
    z-index: 1;
}

@keyframes rotate-border {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.logo-image {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(91, 155, 213, 0.5));
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(91, 155, 213, 0.5));
    }

    50% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 35px rgba(91, 155, 213, 0.7));
    }
}

/* Outer glow ring */
.logo-glow {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 155, 213, 0.15) 0%, transparent 70%);
    animation: glow-pulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.logo-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* Glass Card Effect */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

/* Main Card */
.main-card {
    border-radius: var(--border-radius);
    padding: 40px;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(91, 155, 213, 0.05);
}

.tab-btn.active {
    color: var(--almas-blue);
    border-bottom-color: var(--almas-blue);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Select Input */
.select-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all var(--transition-normal);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a8b5c4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.select-input:focus {
    outline: none;
    border-color: var(--almas-blue);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

.select-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
}

/* Form Styles */
.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.1rem;
}

input[type="text"],
input[type="date"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all var(--transition-normal);
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--almas-blue);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

input::placeholder {
    color: var(--text-muted);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.preset-btn:hover {
    background: rgba(91, 155, 213, 0.1);
    border-color: var(--almas-blue);
    color: var(--text-primary);
}

.preset-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(91, 155, 213, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    transition: transform var(--transition-fast);
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    display: none;
}

.submit-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Area */
.status-area {
    margin-top: 24px;
}

.status-area.hidden {
    display: none;
}

.status-message {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
}

.status-message.info {
    background: rgba(91, 155, 213, 0.1);
    border: 1px solid rgba(91, 155, 213, 0.3);
    color: var(--almas-blue-light);
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.status-message small {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
}

/* Results Section */
.results-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.results-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--almas-blue-light);
}

.results-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--success);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.publish-btn {
    background: var(--accent-gradient-horizontal);
}

.publish-btn:hover {
    background: var(--accent-gradient);
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.3);
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

/* Preview Table */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preview-table th,
.preview-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.preview-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--almas-silver);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.preview-table tbody tr {
    transition: background var(--transition-fast);
}

.preview-table tbody tr:hover {
    background: rgba(91, 155, 213, 0.05);
}

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

.preview-table td.price {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-weight: 500;
}

.preview-table td.high {
    color: var(--success);
}

.preview-table td.low {
    color: var(--error);
}

.preview-table td.volume {
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.preview-table td.ticker {
    font-weight: 600;
    color: var(--almas-blue);
}

.preview-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--almas-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 20px 16px;
    }

    .main-card {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .logo-image {
        width: 100px;
        height: 100px;
    }

    .logo-text h1 {
        font-size: 1.6rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .download-btn {
        justify-content: center;
    }

    .preset-buttons {
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(91, 155, 213, 0.3);
}

/* Selection */
::selection {
    background: var(--almas-blue);
    color: white;
}

/* Greeks Tab Styling */
.model-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(91, 155, 213, 0.08);
    border: 1px solid rgba(91, 155, 213, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
    margin-bottom: 24px;
}

.badge-icon {
    font-size: 1.3rem;
}

.badge-text {
    font-size: 0.9rem;
    color: var(--almas-blue-light);
    font-weight: 500;
}

.greeks-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.legend-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-item strong {
    color: var(--almas-blue);
}

.greeks-btn {
    background: linear-gradient(135deg, #2d8a5f 0%, #1f6847 100%);
}

.greeks-btn:hover {
    box-shadow: 0 10px 30px rgba(45, 138, 95, 0.35);
}

/* Rate Input Group */
.rate-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-select {
    flex: 1;
    min-width: 100px;
}

.rate-text-input {
    width: 80px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 12px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    text-align: center;
}

.rate-text-input:focus {
    outline: none;
    border-color: var(--almas-blue);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

.rate-suffix {
    color: var(--text-secondary);
    font-weight: 500;
}
