* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #1f2937;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 40px;
}

.logo i {
    font-size: 32px;
    color: #ffd700;
}

.logo .highlight {
    color: #ffd700;
}

.score-info {
    margin-bottom: 30px;
}

.info-title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.info-scale {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
}

.scale-item {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
}

.scale-item:last-child {
    margin-bottom: 0;
}

.scale-item.excellent {
    background: rgba(16, 185, 129, 0.3);
}

.scale-item.good {
    background: rgba(59, 130, 246, 0.3);
}

.scale-item.warning {
    background: rgba(245, 158, 11, 0.3);
}

.scale-item.bad {
    background: rgba(239, 68, 68, 0.3);
}

.spam-alert {
    background: rgba(239, 68, 68, 0.2);
    border-left: 3px solid #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spam-alert i {
    color: #ef4444;
    font-size: 16px;
}

.sidebar-features {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-features .feature-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    opacity: 0.9;
}

.sidebar-features .feature-mini i {
    color: #10b981;
    font-size: 18px;
    width: 24px;
}

/* Main content */
.main {
    flex: 1;
    background: white;
    border-radius: 30px 0 0 30px;
    margin: 10px 10px 10px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    flex: 1;
    padding: 30px 40px 20px 40px;
    overflow-y: auto;
}

.header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #1f2937;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 30px;
}

/* Steps horizontales */
.steps-horizontal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f3f4f6;
    padding: 15px 25px;
    border-radius: 50px;
    margin-bottom: 30px;
}

.step-h {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.step-text {
    font-size: 14px;
    font-weight: 500;
}

.steps-horizontal i {
    color: #6366f1;
}

/* Editor card */
.editor-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.editor-header {
    background: #f9fafb;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ef4444;
}

.dot.yellow {
    background: #f59e0b;
}

.dot.green {
    background: #10b981;
}

.editor-title {
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

textarea {
    width: 100%;
    padding: 20px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #ffffff;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
}

.chars-count {
    color: #9ca3af;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-analyze {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-analyze:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13px;
    margin-top: 15px;
}

.trust-badge i {
    color: #10b981;
}

/* Main footer */
.main-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #4b5563;
    border-radius: 0 0 0 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand i {
    color: #6366f1;
}

.footer-features {
    display: flex;
    align-items: center;
    gap: 25px;
}

.footer-features span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-features i {
    color: #10b981;
    font-size: 14px;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logos i {
    font-size: 20px;
    opacity: 0.7;
    transition: all 0.3s;
    cursor: default;
}

.footer-logos i:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-logos .fa-google {
    color: #ea4335;
}

.footer-logos .fa-microsoft {
    color: #00a4ef;
}

.footer-logos .fa-yahoo {
    color: #6001d2;
}

/* History panel */
.history-panel {
    margin-top: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
    opacity: 0.9;
}

.history-header i {
    color: #ffd700;
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    cursor: default;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.history-date {
    opacity: 0.7;
}

.history-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

.history-footer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 5px;
}

#historyCount {
    color: #ffd700;
    font-weight: 600;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 30px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f9fafb, #ffffff);
    border-radius: 30px 30px 0 0;
}

.modal-header h2 {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: #6366f1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 30px;
}

.modal-score {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    background: #f9fafb;
    padding: 25px;
    border-radius: 20px;
}

.big-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.big-score-circle span {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}

.big-score-circle small {
    font-size: 14px;
    opacity: 0.9;
}

.modal-score-text {
    flex: 1;
}

.score-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.score-badge.excellent {
    background: #10b981;
    color: white;
}

.score-badge.good {
    background: #3b82f6;
    color: white;
}

.score-badge.warning {
    background: #f59e0b;
    color: white;
}

.score-badge.bad {
    background: #ef4444;
    color: white;
}

.modal-score-text p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.modal-spam-alert {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.modal-spam-alert i {
    color: #ef4444;
    font-size: 20px;
}

.modal-spam-alert strong {
    color: #ef4444;
}

.modal-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.check-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.check-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.check-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.check-status.pass {
    background: #10b981;
    color: white;
}

.check-status.fail {
    background: #ef4444;
    color: white;
}

.check-status.warning {
    background: #f59e0b;
    color: white;
}

.check-item strong {
    color: #1f2937;
    margin-right: 8px;
}

.check-item span {
    color: #6b7280;
    font-size: 14px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-outline {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Loading modal */
.loading-content {
    text-align: center;
    padding: 40px;
}

.loader {
    border: 4px solid #f3f3f6;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Scroll personalizado */
.modal-content::-webkit-scrollbar,
.modal-checks::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track,
.modal-checks::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb,
.modal-checks::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modal-checks::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ============================================
   RESPONSIVE PARA TABLET Y MÓVIL
   ============================================ */
@media (max-width: 1024px) {
    body {
        overflow: auto;
        height: auto;
    }
    
    .app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    /* Sidebar */
    .sidebar {
        width: 100%;
        height: auto;
        padding: 25px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Sidebar features en horizontal en tablet */
    .sidebar-features {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 20px;
    }
    
    .sidebar-features .feature-mini {
        flex: 1;
        min-width: 120px;
        padding: 8px 0;
    }
    
    /* Historial en sidebar */
    .history-panel {
        margin-top: 20px;
    }
    
    .history-list {
        max-height: 100px;
    }
    
    /* Main content */
    .main {
        margin: 0;
        border-radius: 30px 30px 0 0;
        height: auto;
        min-height: auto;
    }
    
    .main-content {
        padding: 25px;
    }
    
    /* Header */
    .header h1 {
        font-size: 28px;
        text-align: center;
    }
    
    .subtitle {
        text-align: center;
        font-size: 15px;
    }
    
    /* Steps horizontales - MEJORADO PARA TABLET */
    .steps-horizontal {
        display: grid;
        grid-template-columns: 1fr auto 1fr auto 1fr;
        align-items: center;
        gap: 5px;
        background: #f3f4f6;
        padding: 15px;
        border-radius: 50px;
        margin-bottom: 25px;
    }
    
    .step-h {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .step-text {
        font-size: 12px;
        max-width: 100px;
    }
    
    .steps-horizontal i {
        color: #6366f1;
        font-size: 16px;
    }
    
    /* Editor card */
    .editor-card {
        margin-bottom: 20px;
    }
    
    .editor-header {
        padding: 12px 15px;
    }
    
    textarea {
        min-height: 180px;
        font-size: 14px;
        padding: 15px;
    }
    
    .editor-footer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
    }
    
    .chars-count {
        order: 1;
    }
    
    .button-group {
        order: 2;
        display: flex;
        gap: 8px;
    }
    
    .btn-analyze, .btn-clear {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-analyze span {
        display: inline-block;
    }
    
    /* Trust badge */
    .trust-badge {
        text-align: center;
        justify-content: center;
    }
    
    /* Footer */
    .main-footer {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 15px 25px;
    }
    
    .footer-brand {
        order: 1;
    }
    
    .footer-features {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .footer-logos {
        order: 3;
    }
    
    /* Modal */
    .modal-content {
        width: 90%;
        max-width: 600px;
    }
    
    .modal-score {
        flex-direction: row;
        text-align: left;
    }
    
    .big-score-circle {
        width: 100px;
        height: 100px;
    }
    
    .big-score-circle span {
        font-size: 40px;
    }
    
    .modal-footer {
        flex-direction: row;
    }
    
    .btn-outline, .btn-primary {
        width: auto;
        padding: 10px 20px;
    }
}

/* ============================================
   RESPONSIVE PARA MÓVIL PEQUEÑO (menos de 600px)
   ============================================ */
@media (max-width: 600px) {
    .steps-horizontal {
        grid-template-columns: 1fr;
        gap: 10px;
        border-radius: 20px;
    }
    
    .steps-horizontal i {
        transform: rotate(90deg);
        display: none; /* Opcional: ocultar flechas en móvil pequeño */
    }
    
    .step-h {
        flex-direction: row;
        justify-content: center;
    }
    
    .step-text {
        max-width: none;
        font-size: 14px;
    }
    
    .editor-footer {
        flex-direction: column;
    }
    
    .chars-count {
        order: 2;
    }
    
    .button-group {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .btn-analyze, .btn-clear {
        flex: 1;
        justify-content: center;
    }
    
    .main-footer {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-features {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-score {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-outline, .btn-primary {
        width: 100%;
    }
}

/* ============================================
   AJUSTES PARA IPAD EN HORIZONTAL
   ============================================ */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
    .app {
        flex-direction: row;
    }
    
    .sidebar {
        width: 250px;
    }
    
    .steps-horizontal {
        grid-template-columns: 1fr auto 1fr auto 1fr;
    }
    
    .step-text {
        font-size: 13px;
    }
}