:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --error-color: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

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

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

/* Background Effects */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #06b6d4;
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
}

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

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
}

input::placeholder {
    color: var(--text-secondary);
}

.btn-primary {
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    padding: 0 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

/* Result Card */
.result-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-wrapper {
    width: 100%;
    height: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.image-wrapper:hover .btn-icon {
    opacity: 1;
}

.btn-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    backdrop-filter: blur(4px);
}

.btn-icon:hover {
    background: var(--accent-color);
    color: #0f172a;
    transform: scale(1.1);
}

.btn-icon.hidden {
    display: none;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.image-wrapper img:hover {
    transform: scale(1.05);
}

.image-placeholder {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.info-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.brand {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Utilities */
.hidden {
    display: none !important;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top: 2px solid #0f172a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem;
    }
}

/* Header Content Layout */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-small:hover {
    background: var(--accent-color);
    color: #0f172a;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important;
    /* Keep flex to center, just hide opacity/events */
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: scale(0.95);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

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

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: white;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

.divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 1.5rem 0;
}

.api-activation-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.text-sm {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.success-box p {
    color: #34d399;
    margin-bottom: 0.5rem;
}

.success-box code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 0.25rem;
    color: #a7f3d0;
    font-size: 0.8rem;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.btn-xs {
    background: rgba(16, 185, 129, 0.2);
    border: none;
    color: #34d399;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-xs:hover {
    background: rgba(16, 185, 129, 0.3);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.full-width {
    width: 100%;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #10b981;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* API Status Header */
.api-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.api-status-header p {
    margin: 0;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-xs-danger {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #f87171;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-xs-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Warning Text */
.warning-text {
    color: #fbbf24 !important;
    font-weight: 500;
}

.text-xs {
    font-size: 0.75rem;
}