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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header h1 i {
    color: #667eea;
    margin-right: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #eef1ff;
    border-color: #764ba2;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-area p {
    color: #666;
    margin: 15px 0;
    font-size: 1.1rem;
}

.formats {
    font-size: 0.9rem;
    color: #888;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10B981;
    color: white;
    margin-top: 20px;
}

.btn-success:hover {
    background: #0da271;
    transform: translateY(-2px);
}

.btn-danger {
    background: #EF4444;
    color: white;
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #dc2626;
}

.result-section {
    margin-bottom: 40px;
    text-align: center;
}

.result-section h2 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.result-placeholder {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    background: #f9f9f9;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-text {
    color: #888;
    font-size: 1.2rem;
    font-style: italic;
}

.processed-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    display: block;
}

.history-section {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

#historyList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.history-item {
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.history-item:hover {
    transform: translateY(-5px);
}

.history-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

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

.history-time {
    font-size: 0.8rem;
    color: #666;
}

.btn-history-download {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-history-download:hover {
    background: #5a67d8;
}

.empty-history {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
    grid-column: 1 / -1;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    #historyList {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
