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

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

.lang-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.lang-row {
    display: contents;
}

.lang-btn {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-weight: 600;
    cursor: default;
    text-align: center;
}

.lang-btn.center {
    background: #f3f4f6;
    border-color: #cbd5e1;
}

.lang-empty-hint {
    color: #718096;
    font-size: 14px;
    text-align: center;
    grid-column: 1 / 4;
    padding: 6px 0;
}

.navbar {
    background: #2d3748;
    color: white;
    padding: 15px 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #a0aec0;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}


body {
    padding-top: 70px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

.main-panel {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.phone-mockup {
    position: sticky;
    top: 90px;
    background: #1a1a1a;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 8px solid #333;
    min-width: 390px;
}

.phone-screen {
    background: #2d2d2d;
    border-radius: 20px;
    padding: 20px;
    height: 600px;
    display: flex;
    /* 👈 */
    flex-direction: column;
    /* 👈 */
}


.phone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 20px;
    font-size: 14px;
}

.phone-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.app-header {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.app-subtitle {
    color: #888;
    font-size: 12px;
    margin-bottom: 20px;
}

.button-grid {
    flex: 1 1 auto;
    /* ocupa el espacio disponible */
    min-height: 0;
    /* evita overflow en contenedores flex */
    overflow-y: auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 20px;

    align-content: start;
    /* 👈 no estires filas para llenar */
    align-items: start;
    /* 👈 los ítems no se estiran verticalmente */
    grid-auto-rows: max-content;
    /* 👈 cada fila toma el alto de su contenido */
}


.mock-button {
    background: #404040;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    color: white;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.mock-button .icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.mock-button.has-custom-icon .icon {
    background-size: cover;
    background-position: center;
}


.nav-bar {
    height: 50px;
    background: #111;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #333;
    border-radius: 0 0 20px 20px;
}


.nav-btn {
    background: none;
    border: none;
    color: #bbb;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-btn:hover {
    color: white;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 40px;
    text-align: center;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    min-height: 120px;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-upload-section {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-section.dragover {
    border-color: #667eea;
    background: #edf2f7;
}

.file-upload-section input[type="file"] {
    display: none;
}

.file-upload-label {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.file-upload-label:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.add-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
}

.add-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-list {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.button-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-item:last-child {
    margin-bottom: 0;
}

.button-info {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

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

.btn-edit {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #4299e1;
    color: white;
}

.btn-edit:hover {
    background: #3182ce;
}

.download-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    z-index: 9999;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);

    /* 🔥 nuevo */
    max-height: 90vh;
    /* límite de altura al 80% de la pantalla */
    overflow-y: auto;
    /* permite scroll vertical dentro del modal */
}


.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content .form-group label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn-modal {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-save {
    background: #28a745;
    color: white;
}

.btn-save:hover {
    background: #218838;
}

.btn-subfolder {
    background: #17a2b8;
    color: white;
}

.btn-subfolder:hover {
    background: #138496;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    body {
        padding-top: 70px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        background: #2d3748;
        display: none;
        padding: 10px 0;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        margin-left: 10px;
    }

    .nav-toggle {
        display: block;
    }

    .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .main-panel {
        padding: 20px;
    }

    .phone-mockup {
        position: relative;
        top: auto;
        margin: 0 auto;
        max-width: 350px;
    }
}

/* Footer */
.footer {
    width: 100%;
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
    border-top: 5px solid #667eea;
}

.skiptranslate {
    display: none;
}