/* ========================================
   FINANCE CALCULATOR STYLES
   Extends styles.css with finance/money theme
======================================== */

/* ========================================
   FINANCE CONTAINER
======================================== */
.finance-container {
    width: 100%;
    max-width: 580px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: visible;
    transition: max-width var(--transition-normal);
}

/* ========================================
   CATEGORY SELECTOR - Gold/Money Theme
======================================== */
.category-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-xs);
    padding: var(--gap-md);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 2px solid #fbbf24;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.category-btn {
    padding: 0.65rem 0.5rem;
    border: none;
    background: white;
    color: #92400e;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    touch-action: manipulation; /* Prevents double-tap zoom */
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '$';
    position: absolute;
    top: 50%;
    left: -100%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.1;
    color: #f59e0b;
    transition: left 0.5s;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover {
    background: #fffbeb;
    transform: translateY(-1px);
    border: 2px solid #fbbf24;
}

.category-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

/* ========================================
   CALCULATOR SELECTION - Emerald Theme
======================================== */
.calculator-selection {
    padding: var(--gap-md);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-bottom: 2px solid #6ee7b7;
}

.selection-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: var(--gap-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calculator-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #6ee7b7;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calculator-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.calculator-select:hover {
    border-color: #34d399;
}

/* ========================================
   CALCULATOR INTERFACE
======================================== */
.calculator-interface {
    padding: var(--gap-md);
}

.calculator-header {
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-sm);
    border-bottom: 2px solid #f1f5f9;
}

.calculator-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* ========================================
   FORMULA DISPLAY - Gold Gradient
======================================== */
.formula-display {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: var(--gap-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--gap-md);
    border: 2px solid #fbbf24;
    position: relative;
    overflow: hidden;
}

.formula-display::after {
    content: '💰';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 4rem;
    opacity: 0.15;
    transform: rotate(-15deg);
}

.formula-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: var(--gap-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.formula-equation {
    font-size: 1.125rem;
    color: #78350f;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
}

/* ========================================
   INPUT FIELDS
======================================== */
.input-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-md);
    margin-bottom: var(--gap-md);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
}

.input-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: var(--gap-xs);
}

.input-symbol {
    font-family: 'Courier New', monospace;
    color: #f59e0b;
    font-weight: 700;
}

.input-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--gap-xs);
}

.finance-input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
    background: white;
    transition: all var(--transition-fast);
}

.finance-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.input-unit {
    padding: 0.75rem;
    background: #fffbeb;
    border: 2px solid #fcd34d;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #92400e;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   CALCULATE BUTTON - Money Shimmer
======================================== */
.calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-md);
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
    background: linear-gradient(135deg, #d97706, #b45309);
}

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

.calculate-btn svg {
    transition: transform var(--transition-fast);
    position: relative;
    z-index: 1;
}

.calculate-btn:hover svg {
    transform: scale(1.2);
}

.calculate-btn span {
    position: relative;
    z-index: 1;
}

/* ========================================
   RESULT DISPLAY - Emerald Success
======================================== */
.result-display {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: var(--gap-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--gap-md);
    border: 2px solid #34d399;
    text-align: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    position: relative;
}

.result-display::before {
    content: '$';
    position: absolute;
    top: 5px;
    left: 15px;
    color: #059669;
    font-size: 2rem;
    font-weight: 700;
    opacity: 0.3;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: var(--gap-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #059669;
    font-family: 'Courier New', monospace;
    margin-bottom: var(--gap-xs);
    word-wrap: break-word;
    text-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.result-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #047857;
}

/* ========================================
   EXPLANATION SECTION
======================================== */
.explanation-section {
    background: #f8fafc;
    padding: var(--gap-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--gap-md);
    border: 2px solid #e2e8f0;
}

.explanation-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 var(--gap-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.explanation-section p {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

/* ========================================
   FINANCIAL TERMS REFERENCE
======================================== */
.terms-reference {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: var(--gap-md);
    border-radius: var(--radius-lg);
    border: 2px solid #fbbf24;
    margin-bottom: var(--gap-md);
}

.terms-reference h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 var(--gap-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-xs);
}

.term-item {
    background: white;
    padding: var(--gap-sm);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 2px solid #fcd34d;
    transition: all var(--transition-fast);
}

.term-item:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.term-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #d97706;
    font-family: 'Courier New', monospace;
}

.term-desc {
    font-size: 0.65rem;
    color: #78350f;
    font-weight: 500;
}

/* ========================================
   TIPS REFERENCE
======================================== */
.tips-reference {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: var(--gap-md);
    border-radius: var(--radius-lg);
    border: 2px solid #34d399;
}

.tips-reference h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 var(--gap-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tips-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-xs);
}

.tip-item {
    background: white;
    padding: var(--gap-sm);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    border: 1px solid #6ee7b7;
    transition: all var(--transition-fast);
}

.tip-item:hover {
    border-color: #10b981;
    transform: translateX(4px);
}

.tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tip-text {
    font-size: 0.75rem;
    color: #047857;
    font-weight: 500;
    line-height: 1.4;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
======================================== */

/* Small tablets and larger phones (576px+) */
@media (min-width: 576px) {
    .finance-container {
        max-width: 600px;
    }

    .category-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-btn {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }

    .calculator-header h2 {
        font-size: 1.25rem;
    }

    .input-fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .terms-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
    .finance-container {
        max-width: 640px;
    }

    .category-selector {
        grid-template-columns: repeat(4, 1fr);
    }

    .category-btn {
        font-size: 0.8125rem;
    }

    .formula-equation {
        font-size: 1.25rem;
    }

    .result-value {
        font-size: 2.5rem;
    }
}

/* Desktops (1024px+) */
@media (min-width: 1024px) {
    .finance-container {
        max-width: 680px;
    }

    .calculator-header h2 {
        font-size: 1.375rem;
    }
}

/* Large desktops (1280px+) */
@media (min-width: 1280px) {
    .finance-container {
        max-width: 720px;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {

    .category-selector,
    .calculate-btn,
    .terms-reference,
    .tips-reference {
        display: none;
    }

    .finance-container {
        box-shadow: none;
    }
}