/* Reset e Variáveis Globais */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Menu Superior (Navbar) */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Página Inicial - Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #0f172a;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de Ferramentas (Cards) */
.tools-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 2rem;
    background: #eff6ff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--primary-color);
}

.tool-card h3 {
    font-size: 1.25rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Layout da Ferramenta de Pôster (Workspace) */
.workspace {
    display: flex;
    height: calc(100vh - 70px); /* Ocupa a tela menos o navbar */
}

.sidebar {
    width: 350px;
    background: var(--card-bg);
    padding: 24px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.control-group small {
    color: var(--text-muted);
}

input[type="file"], input[type="number"], select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
    margin-top: 10px;
}

button:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

#status {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.preview-area {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #e2e8f0;
    overflow-y: auto;
}

.preview-container {
    position: relative;
    max-width: 100%;
    box-shadow: var(--shadow-md);
    background: white;
}

#previewImage {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: grid;
}

.grid-overlay div {
    border: 1px dashed rgba(255, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

/* Estilos do Rodapé */
.main-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.footer-credits {
    font-weight: 600;
    color: var(--text-main);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Rodapé específico para a Sidebar (dentro da ferramenta) */
.sidebar-footer {
    margin-top: auto; /* Empurra para o final da sidebar */
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-footer a {
    color: var(--primary-color);
    text-decoration: none;
}