/* FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* VARIABLES */
:root {
    --primary-light: #99CC33;
    --primary-dark: #76b900;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #f7f7f7;
    --white: #ffffff;
    --shadow: 0 8px 24px rgba(0,0,0,0.05);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

/* RESET & BASE */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
    flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* LAYOUT CONTAINER */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =================================
   Header & Navigation (Unified)
   ================================= */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo img {
    height: 90px;
}

.main-nav .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.main-nav .nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-bottom-color 0.3s;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-light);
}

/* =================================
   Typography & Section Headers
   ================================= */
.section-title {
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.3;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: var(--text-light);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* =================================
   Image Processor Main
   ================================= */
.image-processor-main {
    padding: 4rem 1rem;
    background-color: var(--background-light);
}

.tool-intro {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    text-align: center;
}

.tool-icon-header {
    font-size: 4rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.tool-icon-header i {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   Tool Cards
   ================================= */
.tool-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 2rem;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.tool-card .tool-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 5px solid var(--primary-light);
}

.tool-icon {
    font-size: 1.5rem;
}

.tool-card .tool-title {
    font-size: 1.5rem;
    color: var(--white);
    margin: 0;
    font-weight: 600;
}

.tool-card .tool-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* =================================
   Buttons (Unified)
   ================================= */
.btn {
  padding: 0.8em 1.5em;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: #d5d5d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =================================
   Forms
   ================================= */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required {
    color: var(--error-color);
    font-weight: 700;
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(118, 185, 0, 0.25);
}

.form-select:hover,
.form-input:hover {
    border-color: var(--primary-light);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* =================================
   Filter Parameters
   ================================= */
.filter-explanation {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--info-color);
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-header i {
    font-size: 1.5rem;
    color: var(--info-color);
}

.filter-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.filter-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.parameters-section {
    background: var(--background-light);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
}

/* =================================
   Processing & Results
   ================================= */
.processing-section, .results-section {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.processing-section {
    text-align: center;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-dark);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

#popup-status-text {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.progress-container {
    width: 100%;
    max-width: 90%;
    margin: 0 auto;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 12px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 8px;
}

.status-box {
    background: #f4f7f6;
    border-left: 5px solid var(--primary-light);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.status-box p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.status-box p:last-child {
    margin-bottom: 0;
}

.image-container {
    text-align: center;
    margin: 2rem 0;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid #e0e0e0;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* =================================
   Notifications
   ================================= */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background: var(--success-color);
}

.notification-error {
    background: var(--error-color);
}

/* =================================
   Footer (Unified)
   ================================= */
.main-footer {
    background: var(--text-dark);
    color: #e0e0e0;
    padding: 3rem 1rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #444;
    align-content: flex-end;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section.about {
    flex: 1;
    max-width: 450px;
    min-width: 280px;
}

.footer-links-group {
    display: flex;
    flex: 2;
    justify-content: flex-end;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-section.links {
    min-width: 150px;
}

.footer-logo img {
    max-height: 100px;
    margin-bottom: 1rem;
}

.footer-section .about-text {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.6rem;
}

.footer-section ul a {
    color: #ccc;
    transition: color 0.3s, padding-left 0.3s;
}

.footer-section ul a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =================================
   Responsive Design
   ================================= */
@media (max-width: 992px) {
    .header-container {
        padding: 0 2rem;
    }
    .main-nav .nav-list {
        gap: 1.5rem;
    }
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav .nav-list {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .tool-intro {
        padding: 2rem;
    }

    .tool-card .tool-body {
        padding: 1.5rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links-group {
        justify-content: center;
        gap: 2rem;
        margin-top: 1rem;
    }

    .footer-section.about {
        max-width: 100%;
    }

    .notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container { 
        width: 95%; 
    }
    
    .section-title { 
        font-size: 1.75rem; 
    }
    
    .tool-intro {
        padding: 1.5rem;
    }
    
    .tool-card .tool-header {
        padding: 1.5rem;
    }
    
    .tool-card .tool-body {
        padding: 1rem;
    }
    
    .form-select,
    .form-input {
        padding: 0.6rem;
    }
}

/* =================================
   Animações
   ================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.6s ease;
}

.processing-section {
    animation: fadeInUp 0.6s ease;
}

.results-section {
    animation: fadeInUp 0.6s ease;
}