/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --dark: #1f2937;
    --darker: #111827;
    --light: #f8fafc;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-lg: 16px;
    --gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Enhanced Header */
header {
    background: var(--gradient);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.1;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
}

/* Enhanced Main Content */
main {
    padding: 2.5rem;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
    text-align: center;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#feature-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow-inner);
}

#feature-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

#check-button {
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

#check-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#check-button:active {
    transform: translateY(0);
}

#check-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.examples {
    font-size: 0.95rem;
    color: var(--gray);
}

.example-feature {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 0 2px;
}

.example-feature:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Enhanced Results Section */
.results-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    background: white;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.result-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--darker);
}

.status-badge {
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-badge.safe {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
}

.status-badge.unsafe {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: white;
}

.status-badge.partial {
    background: linear-gradient(135deg, var(--warning), var(--warning-light));
    color: white;
}

/* Enhanced Cards */
.explanation, .tips, .baseline-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--light);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.explanation:hover, .tips:hover, .baseline-info:hover {
    transform: translateY(-2px);
}

.tips {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.baseline-info {
    border-left-color: var(--success);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.explanation h3, .tips h3, .baseline-info h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--darker);
}

/* Enhanced Browser Support */
.browser-support {
    margin-bottom: 2rem;
}

.browser-support h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--darker);
}

.browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.browser-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.browser-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.browser-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
}

.browser-icon.chrome {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.browser-icon.firefox {
    background: linear-gradient(135deg, #ff7139, #ffcd02);
}

.browser-icon.safari {
    background: linear-gradient(135deg, #1e8e3e, #34a853);
}

.browser-icon.edge {
    background: linear-gradient(135deg, #0078d7, #50e6ff);
}

.browser-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.browser-version {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.browser-version.supported {
    background: var(--success);
    color: white;
}

.browser-version.unsupported {
    background: var(--danger);
    color: white;
}

.browser-version.unknown {
    background: var(--gray);
    color: white;
}

/* Enhanced Baseline Info */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.info-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-left: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Enhanced Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--darker);
    color: white;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: var(--radius);
    }
    
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .browser-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        background: var(--primary);
    }
    
    .container {
        border-radius: var(--radius);
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .browser-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional UI Enhancements */
.emoji {
    font-size: 1.3em;
    margin-right: 0.3em;
}

.no-data {
    text-align: center;
    color: var(--gray);
    font-style: italic;
    padding: 2rem;
    background: var(--border-light);
    border-radius: var(--radius);
}

/* Pulse animation for status badges */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.status-badge {
    animation: pulse 2s infinite;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease;
}