:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #111827;
    --light-bg: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.built-with {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.built-with:hover {
    color: var(--primary-color);
}

/* Main Content */
.main {
    padding-bottom: 4rem;
}

.hero {
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Input Section */
.input-section {
    padding: 2rem 0;
}

.url-input-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.url-form {
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    transition: all 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

#urlInput {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem;
}

.extract-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.extract-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

.sample-urls {
    text-align: center;
}

.sample-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.sample-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.sample-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sample-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--light-bg);
}

/* Results Section */
.results-section {
    padding: 2rem 0;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 968px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.panel-header {
    background: var(--light-bg);
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.image-count {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.copy-btn, .download-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover, .download-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Key Points */
.key-points-content {
    padding: 1.5rem;
}

.key-point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.key-point-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.key-point-text {
    flex: 1;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Images Grid */
.images-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.image-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light-bg);
    aspect-ratio: 1;
}

.image-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.image-card:hover .image-overlay {
    transform: translateY(0);
}

/* Metadata */
.metadata-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.metadata-content {
    padding: 1.5rem;
}

.metadata-item {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.metadata-item:last-child {
    border-bottom: none;
}

.metadata-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.metadata-value {
    flex: 1;
    color: var(--text-primary);
}

/* Loading */
.loading-section {
    padding: 4rem 0;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

#modalImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-info {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: center;
}

.modal-download-btn {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .extract-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

.hidden {
    display: none !important;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }