body {
    font-family: "Segoe UI", system-ui, sans-serif;
    background: radial-gradient(circle at top, #0b1b33 0, #02040a 45%, #000000 100%);
    color: #e0f7ff;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
    gap: 20px;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    color: #7df9ff;
    text-shadow: 0 0 10px #00e5ff, 0 0 20px rgba(0, 229, 255, 0.3);
    letter-spacing: 2px;
    font-size: 28px;
    margin: 0 0 10px 0;
}

.calculator, .chat {
    background: rgba(5, 15, 30, 0.95);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #1f3b5b;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25), inset 0 0 20px rgba(0, 229, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.calculator::before,
.chat::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), transparent 60%);
    opacity: 0.4;
    pointer-events: none;
}

#display {
    width: 100%;
    min-height: 60px;
    max-height: 140px;
    font-size: 15px;
    margin-bottom: 15px;
    background: #020712;
    color: #7df9ff;
    border: 1px solid #00e5ff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.4);
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.buttons button {
    height: 50px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #1f3b5b;
    background: radial-gradient(circle at top, #10233b, #050b16);
    color: #e0f7ff;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 12px rgba(0, 229, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #00e5ff;
    background: radial-gradient(circle at top, #1a3a52, #0a1220);
}

.buttons button:active {
    transform: translateY(0px);
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.clear {
    grid-column: span 4;
    background: radial-gradient(circle at top, #5b0b0b, #200000);
    border: 1px solid #ff4d4d;
    color: #ffecec;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.clear:hover {
    background: radial-gradient(circle at top, #7b1515, #3a0a0a);
    border-color: #ff6b6b;
    box-shadow: 0 2px 12px rgba(255, 77, 77, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.clear:active {
    box-shadow: 0 0 4px rgba(255, 77, 77, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chat h2 {
    margin: 0 0 15px 0;
    color: #7df9ff;
    text-shadow: 0 0 8px #00e5ff;
    font-size: 18px;
}

.chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

#userInput {
    flex: 1;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #1f3b5b;
    background: #020712;
    color: #e0f7ff;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#userInput:focus {
    outline: none;
    border-color: #00e5ff;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.btn-send {
    padding: 0 20px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #00e5ff;
    background: radial-gradient(circle at top, #004f6b, #00141f);
    color: #e0f7ff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.7);
    border-color: #7df9ff;
}

.btn-send:active {
    transform: translateY(1px);
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

.btn-new-conversation {
    padding: 0 18px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #ff9500;
    background: radial-gradient(circle at top, #663300, #331600);
    color: #ffe6cc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 0 8px rgba(255, 149, 0, 0.3);
    transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.btn-new-conversation:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(255, 149, 0, 0.6);
    border-color: #ffb84d;
}

.btn-new-conversation:active {
    transform: translateY(1px);
    box-shadow: 0 0 4px rgba(255, 149, 0, 0.3);
}

#chatLog {
    background: #020712;
    height: 280px;
    overflow-y: auto;
    padding: 12px;
    margin-bottom: 0;
    border-radius: 8px;
    border: 1px solid #1f3b5b;
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.25);
    font-size: 14px;
    line-height: 1.5;
}

#chatLog::-webkit-scrollbar {
    width: 6px;
}

#chatLog::-webkit-scrollbar-track {
    background: rgba(0, 229, 255, 0.05);
    border-radius: 8px;
}

#chatLog::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    border-radius: 8px;
}

#chatLog::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
}

.chat-line-user {
    color: #7df9ff;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(125, 249, 255, 0.1);
}

.chat-line-ia {
    color: #a5ffb5;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(165, 255, 181, 0.05);
    border-left: 2px solid #a5ffb5;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .chat h2 {
        font-size: 16px;
    }
    
    #display {
        font-size: 14px;
        min-height: 70px;
        max-height: 130px;
    }
    
    .buttons button {
        height: 45px;
        font-size: 18px;
    }
    
    #chatLog {
        height: 240px;
        font-size: 13px;
    }
    
    #userInput {
        font-size: 13px;
    }
    
    .chat-actions {
        flex-wrap: wrap;
    }
    
    .btn-send, .btn-new-conversation {
        font-size: 12px;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .calculator, .chat {
        padding: 12px;
    }
    
    h1 {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .chat h2 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    #display {
        font-size: 12px;
        min-height: 60px;
        max-height: 100px;
        padding: 10px;
    }
    
    .buttons button {
        height: 40px;
        font-size: 16px;
    }
    
    .clear {
        font-size: 14px;
    }
    
    #chatLog {
        height: 200px;
        font-size: 12px;
        padding: 8px;
    }
    
    .chat-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    #userInput {
        height: 36px;
        font-size: 12px;
        width: 100%;
    }
    
    .btn-send, .btn-new-conversation {
        height: 36px;
        font-size: 11px;
        padding: 0 12px;
        width: 100%;
    }
}
