/* Calculator Screen Styles */
.screen {
    display: none;
    animation: slideIn 0.5s ease;
    flex: 1;
    /* Мобилна оптимизация за клавиатура */
    position: relative;
    overflow-y: auto;
    padding-bottom: env(keyboard-inset-height, 0px); /* iOS keyboard support */
}

.screen.active {
    display: flex;
    flex-direction: column;
    /* Осигуряване на видимост при отворена клавиатура */
    min-height: 0;
}

.screen-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    line-height: 1.5;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    /* Мобилна оптимизация за клавиатура */
    min-height: 0;
    padding: 20px 0;
}

.amount-input {
    font-family: 'Unbounded', sans-serif;
    width: 100%;
    max-width: 300px;
    padding: 20px;
    font-size: 2rem;
    text-align: center;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background: var(--card-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    outline: none;
}

.amount-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
    transform: scale(1.02);
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.quick-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.quick-btn:active {
    transform: translateY(0);
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.nav-btn {
    font-family: 'Unbounded', sans-serif;
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--card-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-section {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
}

.calculation-display {
    font-family: 'Unbounded', sans-serif;
    background: var(--card-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px var(--shadow-color);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    max-width: 500px;
    margin: 0 auto;
    font-size: 1rem;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    font-size: 1rem;
}

.calculation-row.total {
    border-top: 2px solid var(--primary-color);
    padding-top: 15px;
    margin-top: 20px;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.amount {
    font-weight: bold;
}

.currency {
    color: var(--primary-color);
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 30px;
}

.mode-indicator {
    text-align: center;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(52, 73, 94, 0.2);
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .mode-indicator {
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.screen1 .progress-fill { width: 25%; }
.screen2 .progress-fill { width: 50%; }
.screen3 .progress-fill { width: 75%; }
.screen4 .progress-fill { width: 100%; }

/* Screen 4 styles */
.screen4 {
    display: none;
}

.screen4.active {
    display: block;
}

.form-section {
    margin: 20px 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group textarea::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}