:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --danger: #e63946;
    --warning: #fca311;
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    gap: 15px;
}

.input-group input {
    width: 500px;
}

.input-group textarea {
    width: 100%;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
}

input, textarea, select, button {
    padding: 14px 18px;
    border: 2px solid #e1e5ee;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #3aa8d0;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #d32f2f;
}

.results-section {
    display: none;
}

.results-section.active {
    display: block;
}

.result-item {
    padding: 20px;
    border-left: 4px solid var(--primary);
    background: #f8f9ff;
    margin-bottom: 15px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    animation: fadeIn 0.5s ease;
}

.acronym {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.expansion {
    font-size: 1.1rem;
    color: var(--dark);
}

.confidence {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.confidence.high {
    background: rgba(76, 201, 240, 0.2);
    color: #0d6efd;
}

.confidence.medium {
    background: rgba(252, 163, 17, 0.2);
    color: #fd7e14;
}

.confidence.low {
    background: rgba(230, 57, 70, 0.2);
    color: #dc3545;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.history-section {
    display: none;
}

.history-section.active {
    display: block;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e1e5ee;
    transition: var(--transition);
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-acronym {
    font-weight: 600;
}

.history-expansion {
    color: var(--gray);
    flex-grow: 1;
    margin: 0 15px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-actions button {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e5ee;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(150%);
    transition: transform 0.4s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.icon {
    font-size: 1.2rem;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark) transparent transparent transparent;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}