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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.controls input,
.controls select,
.controls button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.controls input,
.controls select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.controls input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.controls button {
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.grid-controls {
    padding: 20px 32px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

#urlList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.url-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 12px;
    gap: 8px;
}

.url-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
}

.grid-container {
    padding: 24px;
    display: grid;
    gap: 16px;
    min-height: 400px;
}

.grid-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.grid-item-header h3 {
    font-size: 14px;
    color: #495057;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item-actions {
    display: flex;
    gap: 8px;
}

.grid-item-actions button {
    padding: 4px 8px;
    border: none;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.screenshot-container {
    position: relative;
    overflow: hidden;
}

.screenshot-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.screenshot-img:hover {
    transform: scale(1.02);
}

.grid-item.loading .screenshot-img {
    filter: blur(5px);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-bar {
    padding: 16px 32px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.status-bar button {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.status-bar button:hover {
    background: #c82333;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #6c757d;
}

.empty-state h2 {
    margin-bottom: 16px;
    color: #495057;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
}