/* Daily Balance Interest Calculator - Tool Styles */

/* Mode Selector */
.mode-selector {
    margin-bottom: 2rem;
}

.mode-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    flex-direction: column;
}

.option-item label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.option-item input,
.option-item select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.option-item input:focus,
.option-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.dark-mode .option-item input,
body.dark-mode .option-item select {
    background: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Deposits Table */
.deposits-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.deposits-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

.deposits-table thead {
    background: var(--primary-color);
    color: white;
}

.deposits-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.deposits-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.deposits-table tbody tr:hover {
    background: var(--primary-color);
    background-opacity: 0.05;
}

.deposit-row input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.95rem;
    background: var(--surface-color);
    color: var(--text-color);
}

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

.btn-remove-deposit {
    padding: 0.5rem 0.75rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-remove-deposit:hover {
    background: #dc2626;
}

.action-btn.secondary {
    background: var(--border-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.375rem;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Breakdown */
.breakdown-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

#breakdownOutput {
    width: 100%;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: var(--surface-color);
    color: var(--text-color);
    border: none;
}

/* Tool Actions */
.tool-actions-horizontal {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.action-btn.success:hover {
    background: #059669;
    border-color: #059669;
}

/* Hint Text */
.hint {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    margin-top: 0.5rem;
}

/* Checkbox Option */
.option-item.checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.option-item.checkbox label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    cursor: pointer;
}

.option-item.checkbox input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Instructions */
.instructions {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.instructions h3 {
    margin-bottom: 1.5rem;
}

.instruction-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    padding: 1rem;
}

.step h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.step p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color-secondary);
    margin-bottom: 0.5rem;
}

/* Use Cases */
.use-cases {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.use-cases h3 {
    margin-bottom: 1.5rem;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.use-case-item {
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.375rem;
    text-align: left;
}

.use-case-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.use-case-item h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.use-case-item p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    line-height: 1.5;
}

/* Error Message */
.error-msg {
    margin-top: 1rem;
    padding: 1rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    display: none;
}

.error-msg.show {
    display: block;
}

body.dark-mode .error-msg {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
    }

    .mode-btn {
        width: 100%;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .deposits-table {
        font-size: 0.875rem;
    }

    .deposits-table th,
    .deposits-table td {
        padding: 0.5rem;
    }

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

    .instruction-steps {
        grid-template-columns: 1fr;
    }

    .use-case-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
body.dark-mode .deposits-table {
    background: var(--surface-color);
}

body.dark-mode .deposits-table thead {
    background: var(--primary-color);
}

body.dark-mode .result-item {
    background: rgba(96, 165, 250, 0.2);
    border-left: 4px solid #60a5fa;
    color: var(--text-color);
}

body.dark-mode .result-value {
    color: #60a5fa;
}

body.dark-mode .use-case-item {
    background: rgba(96, 165, 250, 0.2);
    border-left: 4px solid #60a5fa;
}

body.dark-mode .action-btn.primary {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .action-btn.primary:hover {
    background: var(--primary-color);
    opacity: 0.85;
}

body.dark-mode .action-btn.secondary {
    background: #8b5cf6;
    color: white;
}

body.dark-mode .action-btn.success {
    background: #10b981;
    color: white;
}

/* Error Message Display */
.error-msg {
    display: none;
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
    border-radius: 0.5rem;
    font-weight: 500;
}

.error-msg.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark-mode .error-msg {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left-color: #ef4444;
}

/* Dark Mode Adjustments */
body.dark-mode .mode-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

body.dark-mode .mode-btn:hover {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

body.dark-mode .mode-btn.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
}

body.dark-mode .deposits-table thead {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
}

body.dark-mode .deposits-table thead th {
    color: #93c5fd !important;
}

body.dark-mode .action-btn.primary {
    background: rgba(59, 130, 246, 0.7) !important;
    color: white !important;
}

body.dark-mode .action-btn.primary:hover {
    background: rgba(59, 130, 246, 0.5) !important;
    opacity: 1 !important;
}

/* Action Button Styling */
.tool-actions-horizontal {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.secondary {
    background: var(--secondary-color, #8b5cf6);
    color: white;
}

.action-btn.secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.action-btn.success {
    background: #10b981;
    color: white;
}

.action-btn.success:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.action-btn:not(.primary):not(.success):not(.secondary) {
    background: var(--border-color);
    color: var(--text-color);
}

.action-btn:not(.primary):not(.success):not(.secondary):hover {
    background: var(--primary-color);
    color: white;
}

.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

