@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0b2b1f 0%, #12372a 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
}

/* Декоративные круги */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Главная карточка */
.glass-card {
    background: rgba(18, 28, 24, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(74, 222, 128, 0.25);
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(74, 222, 128, 0.1) inset;
    padding: 2rem;
    transition: all 0.3s ease;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a3e8b3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.subtitle {
    text-align: center;
    color: #b9e6c9;
    font-weight: 400;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(74, 222, 128, 0.3);
    padding-bottom: 1rem;
    font-size: 1rem;
}

/* Переключатель перефразирования */
.paraphrase-toggle {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(74, 222, 128, 0.3);
    transition: all 0.2s;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: #e2f0e6;
    font-size: 1rem;
}

.switch-label input {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: #22c55e;
}

.hint {
    margin: 0.5rem 0 0 1.8rem;
    font-size: 0.75rem;
    color: #8dbd9f;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    border: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.9rem 2rem;
    border-radius: 3rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    backdrop-filter: blur(4px);
}

.btn i {
    font-size: 1.2rem;
}

.primary-btn {
    background: linear-gradient(105deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
    background: linear-gradient(105deg, #2cd86a, #18b04e);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: #e2f0e6;
    border: 1px solid rgba(74, 222, 128, 0.5);
}

.secondary-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    transform: translateY(-2px);
    border-color: #22c55e;
}

/* Область ручного ввода */
#textInputArea {
    margin: 1rem 0 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1.5rem;
    padding: 1.2rem;
    border: 1px solid rgba(74, 222, 128, 0.4);
    transition: all 0.2s;
}

textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Inter', monospace;
    border-radius: 1.2rem;
    border: none;
    background: rgba(30, 41, 35, 0.8);
    color: #eef5f0;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
}

textarea:focus {
    background: #1f2e26;
    box-shadow: 0 0 0 2px #22c55e;
}

.action-btn {
    background: #22c55e;
    color: #0a1f16;
    font-weight: 700;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

.action-btn:hover {
    background: #2dd36b;
}

/* Результаты */
.result-area {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.result-card, .original-card {
    background: rgba(10, 20, 16, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    padding: 1.2rem 1.5rem;
    border: 1px solid rgba(74, 222, 128, 0.3);
    transition: transform 0.15s;
}

.result-card:hover, .original-card:hover {
    border-color: rgba(74, 222, 128, 0.6);
}

.result-card h3, .original-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #c0f0d0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.output-text {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1rem;
    line-height: 1.45;
    color: #f0faf4;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 400;
    border-left: 3px solid #22c55e;
    margin-bottom: 1rem;
}

.result-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.small-btn {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #cfffe0;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.small-btn:hover {
    background: rgba(34, 197, 94, 0.4);
    border-color: #22c55e;
    color: white;
    transform: scale(0.96);
}

.favorite-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fed7d7;
}

.favorite-btn:hover {
    background: rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
}

/* Секция избранного */
.favorites-section {
    margin-top: 2.5rem;
    border-top: 1px solid rgba(74, 222, 128, 0.4);
    padding-top: 1.5rem;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.favorites-header h3 {
    font-size: 1.4rem;
    color: #e2f0e6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.excel-btn {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
}

.excel-btn:hover {
    background: #22c55e;
    color: #0a1f16;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.3rem;
}

/* Кастомный скролл */
.favorites-list::-webkit-scrollbar {
    width: 6px;
}
.favorites-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
.favorites-list::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 10px;
}

.favorite-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-radius: 1.2rem;
    padding: 1rem 1.2rem;
    border-left: 4px solid #22c55e;
    transition: all 0.2s;
}

.favorite-card:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateX(4px);
}

.fav-original, .fav-paraphrased {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
    color: #e0f2e8;
}
.fav-original strong, .fav-paraphrased strong {
    color: #86efac;
}
.fav-date {
    font-size: 0.7rem;
    color: #8dbd9f;
    margin: 0.3rem 0;
}

.remove-fav {
    background: rgba(220, 38, 38, 0.2);
    border-color: #ef4444;
    margin-top: 0.3rem;
}
.remove-fav:hover {
    background: #ef4444;
    color: white;
}

/* Статус-сообщение */
.status-message {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: inline-block;
    width: auto;
    backdrop-filter: blur(4px);
}

.hidden {
    display: none;
}

/* Адаптивность */
@media (max-width: 700px) {
    .glass-card {
        padding: 1.2rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
    }
}