:root {
    --primary: #06B6D4;
    --secondary: #22D3EE;
    --accent: #F97316;
    --bg-main: #0A1A1F;
    --bg-card: rgba(10, 26, 31, 0.6);
    --bg-input: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo svg {
    color: var(--primary);
}

.highlight {
    color: var(--primary);
}

.actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s var(--transition);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

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

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn.secondary:hover:not(:disabled) {
    background: var(--bg-input);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn.danger.outline {
    background: transparent;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn.danger.outline:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Search Section */
.search-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    transition: border-color 0.3s var(--transition), box-shadow 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2), var(--shadow);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    color: var(--text-muted);
}

#urlInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 1rem 1rem 1rem 3.5rem;
    outline: none;
    font-family: inherit;
}

#urlInput::placeholder {
    color: var(--text-muted);
}

#analyzeBtn {
    border-radius: var(--radius-full);
    padding: 0.8rem 2rem;
    min-width: 120px;
}

.error-message {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

/* Results Section */
.results-container {
    animation: slideUp 0.5s var(--transition) both;
}

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

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--secondary);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: transform 0.3s var(--transition), border-color 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.tech-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.tech-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background 0.2s;
}

.tech-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.05);
}

.tech-name {
    font-weight: 500;
}

.tech-confidence {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.tech-confidence.high { color: #4ade80; }
.tech-confidence.medium { color: #facc15; }
.tech-confidence.low { color: #f87171; }

.empty-category {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: #112228;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s var(--transition) both;
}

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

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.history-url {
    font-weight: 500;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .header {
        margin-bottom: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
