:root {
    --primary: #003366;
    /* Azul Gobierno */
    --secondary: #0056b3;
    /* Azul Claro */
    --accent: #e9ecef;
    /* Gris Fondo App */
    --white: #ffffff;
    --text: #2c3e50;
    --border: #dee2e6;
    --success: #28a745;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    display: flex;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--primary);
    color: var(--white);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo-area {
    text-align: center;
    margin-bottom: 40px;
}

.logo-area h1 {
    font-size: 1.4rem;
    margin-top: 10px;
    font-weight: 600;
}

.steps-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    padding: 10px 15px;
    border-radius: 6px;
    cursor: default; /* Changed from pointer since no click handler exists */
    font-size: 0.9rem;
    opacity: 0.7;
    transition: all 0.3s;
}

.step-item.active {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
    font-weight: 600;
    border-left: 4px solid var(--white);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background-color: #fff;
    position: relative;
}

.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: 0;
    }
}

h2 {
    color: var(--primary);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.row {
    display: flex;
    gap: 20px;
}

.half {
    flex: 1;
}

/* Buttons */
.nav-buttons {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: var(--accent);
    color: var(--text);
}

.btn-secondary:hover {
    background: #dbe2e8;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    margin-left: 10px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto; /* Scroll horizontal if needed */
}

.tab-btn {
    background: none;
    padding: 10px 20px;
    color: #666;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Editor */
.editor {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    font-size: 1rem;
    resize: vertical;
}

.editor-small {
    font-family: inherit;
    font-size: 0.95rem;
}

.checklist-container {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.checklist-item input {
    width: auto;
    margin-top: 5px;
    margin-right: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* AI Chat */
.ai-chat-box {
    margin-top: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ai-chat-input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ai-chat-input-group input {
    flex: 1;
}

.description-box {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 5px solid #1976d2;
}

.description-box h4 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
}

.description-box strong {
    font-weight: 700;
    /* ensure strong remains inline */
    display: inline;
}

.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

@media (min-width: 600px) {
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* Success */
.success-box {
    text-align: center;
    padding: 40px;
}

.download-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    color: white;
}

.btn-download.word {
    background: #2b579a;
}

.btn-download.pdf {
    background: #b30b00;
}

.file-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.file-chip {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 16px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #3c4043;
    max-width: 100%;
}

.file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-chip i.fa-file-pdf {
    color: #b30b00;
}

.file-chip .remove-btn {
    cursor: pointer;
    color: #5f6368;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
}

.file-chip .remove-btn:hover {
    color: #d93025;
}

.file-area {
    background: #fafafa;
    padding: 15px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.file-area label {
    cursor: pointer;
    color: var(--primary);
}

.file-area input[type="file"] {
    display: none;
}

.btn-google {
    background-color: #4285F4 !important;
    color: white !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    margin-top: 10px;
}

.btn-google:hover {
    background-color: #3367d6 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-google i {
    font-size: 1.1rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        height: auto;
        padding: 0;
        background-color: var(--white);
    }
    
    .app-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar .steps-nav {
        display: none; /* Hide steps list on mobile */
    }

    .logo-area {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .logo-area h1 {
        font-size: 1.2rem;
        margin-top: 0;
    }

    .content-area {
        padding: 20px;
    }

    .row {
        flex-direction: column;
        gap: 15px;
    }

    .half {
        width: 100%;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .nav-buttons {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .nav-buttons button {
        width: 100%;
    }
    
    .btn-outline {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    .btn-google {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .ai-chat-input-group {
        flex-direction: column;
    }
    
    .ai-chat-input-group button {
        width: 100%;
    }
    
    /* Make input group for finding email wrap or stack */
    .input-group {
        display: flex;
        flex-direction: column;
    }
    
    .input-group input {
        border-radius: 6px;
    }
    
    .input-group button.btn-outline {
        margin-left: 0;
        margin-top: 10px;
    }
}