:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --input-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.nav-links {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border-radius: 2.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.highlight {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #cbd5e1;
}

input, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

input::placeholder, textarea::placeholder {
    color: #475569;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.2);
}

.btn:hover {
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4), 0 4px 6px -2px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 0px 0px 0px rgba(99, 102, 241, 0.4);
}

.btn:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.btn.loading span {
    display: none;
}

.btn.loading .spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.log-section {
    margin-top: 1.5rem;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hidden state utility */
.hidden {
    display: none !important;
}

/* Simple logs */
.simple-log-success, .simple-log-error {
    padding: 1.25rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.3s ease;
}

.simple-log-success {
    border-left: 4px solid var(--success);
    color: #34d399;
}

.simple-log-error {
    border-left: 4px solid var(--error);
    color: #f87171;
}

.log-item {
    line-height: 1.5;
}

/* Professional Results Panel */
.result-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.header-success .result-message {
    color: #f8fafc;
}

.header-error .result-message {
    color: #f8fafc;
}

.success-icon {
    color: #10b981;
}

.error-icon {
    color: #ef4444;
}

.result-message {
    font-size: 1.1rem;
    line-height: 1.5;
}

.api-msg {
    color: var(--text-muted);
}

/* URL Table */
.url-table-container {
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.url-table-container::-webkit-scrollbar {
    width: 8px;
}
.url-table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}
.url-table-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

.url-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.url-table th {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 1);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #cbd5e1;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.url-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.url-table tr:last-child td {
    border-bottom: none;
}

.url-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.url-cell {
    font-size: 0.95rem;
    color: #f8fafc;
    word-break: break-all;
    line-height: 1.4;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .card {
        padding: 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .url-table th, .url-table td {
        padding: 1rem;
    }
    
    .url-table th:nth-child(2),
    .url-table td:nth-child(2) {
        width: 100px;
    }
}
