/* Medical Billing Calculator Page Styles
   Color Palette: Caribbean/Florida Keys/Miami Vibe
   - Teal: #20B2AA (Light Sea Green)
   - Pink: #FF6B9D (Hot Pink)
   - Seafoam: #7FDBDA
   - Deep Teal: #008B8B
   - Coral Pink: #FF7F7F
   - Sand: #F5E6D3
   - Ocean Blue: #40E0D0 (Turquoise)
*/

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ==================== MAIN LAYOUT ==================== */
.calculator-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #D5F6FF 0%, #CCEEE8 50%, #E1F9F5 100%);
}

/* ==================== HEADER ==================== */
.calculator-header {
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 50%, #40E0D0 100%);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
}

/* Home button in calculator header */
.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #ffffff;
    font-size: 1.2rem;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.home-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.home-btn:active {
    transform: scale(0.95);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.header-title i {
    font-size: 1.4rem;
}

/* Clear All Button */
.clear-all-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: rgba(255, 107, 157, 0.8);
    border-color: #FF6B9D;
}

/* ==================== CALCULATOR CONTAINER ==================== */
.calculator-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

/* ==================== INITIAL ADD CALCULATION BUTTON ==================== */
.add-calculation-initial {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.add-calc-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 60px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.4);
}

.add-calc-btn-large i {
    font-size: 3rem;
}

.add-calc-btn-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(255, 107, 157, 0.5);
}

.add-calc-btn-large:active {
    transform: translateY(-2px);
}

.add-calc-hint {
    margin-top: 16px;
    color: #008B8B;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ==================== CALCULATOR STACK ==================== */
.calculator-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* ==================== INLINE ADD BUTTON (Circle) ==================== */
.add-calculation-inline {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.add-calc-btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
    color: #ffffff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.add-calc-btn-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.add-calc-btn-circle:active {
    transform: scale(1.05);
}

/* ==================== POPUP OVERLAY ==================== */
.calc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calc-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.calc-popup {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.calc-popup-overlay.active .calc-popup {
    transform: scale(1);
}

.popup-header {
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #FF6B9D;
}

.popup-header h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.popup-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-calc-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #F0FDFD 0%, #E0F7FA 100%);
    border: 2px solid #7FDBDA;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.popup-calc-option:hover {
    background: linear-gradient(135deg, #E0F7FA 0%, #7FDBDA 100%);
    border-color: #20B2AA;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.2);
}

.option-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    font-size: 1rem;
    font-weight: 600;
    color: #008B8B;
}

.option-desc {
    font-size: 0.8rem;
    color: #666;
}

/* ==================== CALCULATOR CARDS ==================== */
.calculator-card-wrapper {
    width: 100%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #FF6B9D;
    box-shadow:
        0 20px 60px rgba(32, 178, 170, 0.35),
        0 12px 35px rgba(0, 139, 139, 0.25),
        0 0 80px rgba(127, 219, 218, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.card-header {
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    padding: 16px 24px;
    border-bottom: 3px solid #FF6B9D;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-header-left {
    flex: 1;
}

.card-header h2 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    font-size: 1rem;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin: 0;
}

/* Card Delete Button */
.card-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.card-delete-btn:hover {
    background: rgba(255, 107, 157, 0.8);
    transform: scale(1.1);
}

.card-body {
    padding: 20px 24px;
}

/* ==================== CALCULATOR CONTENT LAYOUT ==================== */
.calc-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.calc-inputs {
    display: flex;
    flex-direction: column;
}

.calc-results {
    display: flex;
    flex-direction: column;
}

/* ==================== INPUT STYLES ==================== */
.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    color: #008B8B;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #F0FDFD;
    border: 2px solid #7FDBDA;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #FF6B9D;
    box-shadow: 0 0 12px rgba(255, 107, 157, 0.25);
}

.input-prefix,
.input-suffix {
    padding: 10px 14px;
    background: #E0F7FA;
    color: #008B8B;
    font-weight: 600;
    font-size: 0.9rem;
}

.calc-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #333;
    outline: none;
}

.calc-input::placeholder {
    color: #a0d4d4;
}

.calc-input.error {
    background: #fff0f3;
}

.input-wrapper.error {
    border-color: #e74c3c;
}

/* Input wrapper with button (for sequestration rate) */
.input-wrapper-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-wrapper.narrow {
    flex: 1;
}

.adjust-btn {
    padding: 10px 14px;
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 139, 139, 0.2);
    flex-shrink: 0;
}

.adjust-btn:hover {
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.4);
    transform: translateY(-2px);
}

.adjust-btn:active {
    transform: translateY(0);
}

.adjust-btn i {
    font-size: 1rem;
}

/* ==================== BUTTON STYLES ==================== */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
}

.calc-button {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.calc-button:active {
    transform: translateY(0);
}

.clear-button {
    padding: 12px 20px;
    background: transparent;
    color: #008B8B;
    border: 2px solid #7FDBDA;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.clear-button:hover {
    transform: translateY(-2px);
    background: #7FDBDA;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(127, 219, 218, 0.4);
}

.clear-button:active {
    transform: translateY(0);
}

/* ==================== RESULT STYLES ==================== */
.result-group {
    padding-bottom: 12px;
    border-bottom: 2px dashed #7FDBDA;
    margin-bottom: 12px;
}

.result-row {
    margin-bottom: 10px;
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-title {
    display: block;
    color: #008B8B;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-group > label {
    display: block;
    color: #008B8B;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.result-group .result-row label {
    display: block;
    color: #008B8B;
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.result-value {
    background: linear-gradient(135deg, #E0F7FA 0%, #F0FDFD 100%);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #008B8B;
    text-align: center;
    border: 2px solid #7FDBDA;
}

.result-value.intermediate {
    font-size: 1rem;
    background: #F5F5F5;
    border-color: #ccc;
    color: #666;
    padding: 10px 14px;
}

.result-value.final {
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    color: #ffffff;
    border-color: #008B8B;
    font-size: 1.4rem;
}

/* ==================== MATH BREAKDOWN ==================== */
.math-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.math-breakdown > label {
    display: block;
    color: #008B8B;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-text {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #333;
    background: #F9F9F9;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    resize: none;
    overflow: hidden;
}

.breakdown-text:focus {
    outline: none;
    border-color: #7FDBDA;
}

.breakdown-text::placeholder {
    color: #b0b0b0;
    font-style: italic;
}

.copy-button {
    width: 100%;
    padding: 10px 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.copy-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 139, 139, 0.4);
}

.copy-button:active:not(:disabled) {
    transform: translateY(0);
}

.copy-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.copy-button.copied {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

/* ==================== STATUS MESSAGE ==================== */
.status-message {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid transparent;
    min-height: 1.6em;
    margin-bottom: 12px;
    visibility: hidden;
    background: transparent;
}

.status-message.error {
    visibility: visible;
    color: #e74c3c;
    background: #fdf2f2;
    border-left-color: #e74c3c;
}

.status-message.success {
    visibility: visible;
    color: #27ae60;
    background: #f0fdf4;
    border-left-color: #27ae60;
}

/* ==================== AGGREGATE SECTION ==================== */
.aggregate-section {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 10px;
}

.aggregate-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #20B2AA;
    box-shadow: 0 10px 30px rgba(32, 178, 170, 0.2);
}

.aggregate-header {
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #7FDBDA;
}

.aggregate-header h3 {
    color: #ffffff;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
}

.aggregate-body {
    padding: 16px 20px;
}

.aggregate-text {
    width: 100%;
    min-height: 150px;
    padding: 12px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #333;
    background: #F9F9F9;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    resize: none;
    overflow: hidden;
}

.aggregate-text:focus {
    outline: none;
    border-color: #20B2AA;
}

.aggregate-text::placeholder {
    color: #b0b0b0;
    font-style: italic;
}

.aggregate-button-group {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.aggregate-clear-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 139, 139, 0.2);
}

.aggregate-clear-btn:hover {
    background: linear-gradient(135deg, #20B2AA 0%, #40E0D0 100%);
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.4);
    transform: translateY(-2px);
}

.aggregate-clear-btn:active {
    transform: translateY(0);
}

.aggregate-copy-btn {
    flex: 1;
    padding: 12px 20px;
    margin-top: 0;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
}

.aggregate-copy-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* ==================== SCROLL TO BOTTOM BUTTON ==================== */
.scroll-to-bottom-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 90px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
    border: none;
    border-radius: 30px;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-bottom-btn.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-bottom-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
    background: linear-gradient(135deg, #FF8FAB 0%, #FFA5BD 100%);
}

.scroll-to-bottom-btn:active {
    transform: translateY(-1px);
}

.scroll-to-bottom-btn i {
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

.scroll-to-bottom-btn span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* ==================== KEYPAD POPUP ==================== */
.keypad-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.keypad-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.keypad-popup {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.keypad-popup-overlay.active .keypad-popup {
    transform: scale(1);
}

.keypad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    border-radius: 16px 16px 0 0;
}

.keypad-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.keypad-body {
    padding: 24px;
}

.keypad-display {
    margin-bottom: 20px;
}

.keypad-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: #008B8B;
    background: #F0FDFD;
    border: 2px solid #7FDBDA;
    border-radius: 8px;
    outline: none;
}

.keypad-input.error {
    border-color: #e74c3c;
    background: #fff0f3;
}

.keypad-error-message {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 6px;
    border-left: 4px solid transparent;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.keypad-error-message.show {
    visibility: visible;
    opacity: 1;
    color: #e74c3c;
    background: #fdf2f2;
    border-left-color: #e74c3c;
}

.keypad-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.keypad-num,
.keypad-clear {
    padding: 18px;
    font-size: 1.3rem;
    font-weight: 600;
    background: #F0FDFD;
    border: 2px solid #7FDBDA;
    border-radius: 8px;
    color: #008B8B;
    cursor: pointer;
    transition: all 0.2s ease;
}

.keypad-num:hover,
.keypad-clear:hover {
    background: #E0F7FA;
    border-color: #20B2AA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.2);
}

.keypad-num:active,
.keypad-clear:active {
    transform: translateY(0);
}

.keypad-clear {
    background: #FFE5EC;
    border-color: #FF6B9D;
    color: #FF6B9D;
}

.keypad-clear:hover {
    background: #FFD0DE;
    border-color: #FF6B9D;
}

.keypad-actions {
    display: flex;
    gap: 12px;
}

.keypad-cancel,
.keypad-apply {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.keypad-cancel {
    background: #e0e0e0;
    color: #666;
}

.keypad-cancel:hover {
    background: #d0d0d0;
}

.keypad-apply {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8FAB 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.keypad-apply:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    transform: translateY(-2px);
}

.keypad-apply:active {
    transform: translateY(0);
}

/* ==================== RESPONSIVE - TABLET ==================== */
@media (max-width: 900px) {
    .calc-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calculator-card {
        max-width: 100%;
    }

    .add-calc-btn-large {
        padding: 30px 50px;
        font-size: 1.1rem;
    }

    .add-calc-btn-large i {
        font-size: 2.5rem;
    }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 600px) {
    .calculator-main {
        min-height: 100vh;
    }

    .header-content {
        height: 54px;
        padding: 0 16px;
    }

    .header-title {
        font-size: 1rem;
    }

    .header-title i {
        font-size: 1.2rem;
    }

    .clear-all-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .calculator-container {
        padding: 16px;
    }

    .add-calculation-initial {
        min-height: 200px;
    }

    .add-calc-btn-large {
        padding: 24px 40px;
        font-size: 1rem;
    }

    .add-calc-btn-large i {
        font-size: 2rem;
    }

    .add-calc-hint {
        font-size: 0.85rem;
    }

    .calculator-stack {
        gap: 16px;
    }

    .add-calc-btn-circle {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .calc-popup {
        max-width: 100%;
        margin: 10px;
    }

    .popup-calc-option {
        padding: 14px;
        gap: 12px;
    }

    .option-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .option-title {
        font-size: 0.95rem;
    }

    .option-desc {
        font-size: 0.75rem;
    }

    .calculator-card {
        border-radius: 12px;
    }

    .card-header {
        padding: 14px 18px;
    }

    .card-header h2 {
        font-size: 1rem;
    }

    .card-delete-btn {
        width: 28px;
        height: 28px;
    }

    .card-body {
        padding: 16px 18px;
    }

    .calc-content {
        gap: 16px;
    }

    .input-group {
        margin-bottom: 10px;
    }

    .input-group label {
        font-size: 0.75rem;
    }

    .calc-input {
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    .input-prefix,
    .input-suffix {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .button-group {
        gap: 8px;
    }

    .calc-button,
    .clear-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .result-value {
        padding: 10px 14px;
        font-size: 1.1rem;
    }

    .result-value.final {
        font-size: 1.2rem;
    }

    .breakdown-text {
        min-height: 100px;
        font-size: 0.75rem;
    }

    .copy-button {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .aggregate-section {
        padding-top: 5px;
    }

    .aggregate-header {
        padding: 12px 16px;
    }

    .aggregate-header h3 {
        font-size: 0.9rem;
    }

    .calc-count {
        font-size: 0.8rem;
    }

    .aggregate-body {
        padding: 14px 16px;
    }

    .aggregate-text {
        min-height: 120px;
        font-size: 0.75rem;
    }
}

/* ==================== SMALL MOBILE ==================== */
@media (max-width: 380px) {
    .header-title span {
        display: none;
    }

    .button-group {
        flex-direction: column;
    }

    .calc-button,
    .clear-button {
        width: 100%;
    }

    .add-calc-btn-large {
        padding: 20px 30px;
        font-size: 0.9rem;
    }

    .add-calc-btn-large i {
        font-size: 1.8rem;
    }
}
