/* Custom Styling: Minimalist White Premium Design System */

:root {
    --bg-app: #fafafa;
    --bg-card: #ffffff;
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-muted: #a1a1aa;
    --border-color: #f4f4f5;
    
    --primary: #18181b;
    --primary-hover: #27272a;
    --primary-light: #f4f4f5;
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.03), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* App Container - Mobile focused */
.app-container {
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-app);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 95px; /* Espacio para la barra de navegación de 6 elementos */
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
}

.app-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.rates-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--primary-light);
    padding: 6px 10px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
}

.dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.pulse {
    animation: pulse-anim 1.5s infinite;
}

@keyframes pulse-anim {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* View Sections */
.view-section {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease-out;
}

.view-section.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.section-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.section-card:hover {
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
    color: var(--primary);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 16px;
}

/* Summary Card */
.summary-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    text-align: center;
}

.summary-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.summary-values .val-usdt {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary);
    line-height: 1.1;
}

.summary-values .val-bcv {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.summary-values .val-ves {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* Balance Grid */
.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mini-summary {
    padding: 14px !important;
    text-align: center;
}

.mini-summary .val-sub {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
}

.mini-summary .val-bcv-sub {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mini-summary .val-ves-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.highlight-balance {
    background-color: var(--primary-light) !important;
    border-color: var(--primary);
}

/* Form Styles */
.app-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
}

.due-day-group {
    grid-column: 2;
}

label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background-color: #fafafa;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.05);
}

.input-currency-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-currency-wrapper input {
    padding-right: 80px;
}

.input-currency-wrapper select {
    position: absolute;
    right: 4px;
    width: auto;
    padding: 8px 12px;
    border: none;
    background-color: transparent;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    font-family: var(--font-sans);
    background-color: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

/* List Items style */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.list-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 0;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    transition: transform 0.15s ease;
}

.list-item:hover {
    transform: translateY(-2px);
}

.item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.item-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-description {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}

.item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.item-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.item-amounts {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.amount-main {
    font-weight: 600;
    font-size: 14px;
}

.amount-bcv {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.amount-sec {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    color: var(--danger);
    background-color: var(--danger-bg);
}

.btn-delete svg {
    width: 15px;
    height: 15px;
}

/* Checkbox Style */
.expense-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
    flex-shrink: 0;
}

.expense-checkbox.checked {
    background-color: var(--success);
    border-color: var(--success);
}

.expense-checkbox svg {
    width: 11px;
    height: 11px;
    stroke: #ffffff;
    display: none;
}

.expense-checkbox.checked svg {
    display: block;
}

.list-item.expense-paid, .list-item.project-completed {
    opacity: 0.65;
}

.list-item.expense-paid .item-title, .list-item.project-completed .item-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Calculator Tab */
.calculator-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.calc-icon {
    width: 16px;
    height: 16px;
}

.calc-input-row {
    position: relative;
    display: flex;
    align-items: center;
}

.calc-input {
    font-size: 18px !important;
    font-weight: 600 !important;
    padding: 12px 70px 12px 14px !important;
    background-color: #ffffff !important;
}

.calc-unit {
    position: absolute;
    right: 16px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted);
}

/* Bloc de Notas */
.notes-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 250px);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.notes-status {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    background-color: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.notes-textarea {
    flex: 1;
    resize: none;
    border: none;
    background-color: transparent !important;
    padding: 0 !important;
    font-size: 15px;
    line-height: 1.6;
    height: 100%;
    min-height: 250px;
}

.notes-textarea:focus {
    box-shadow: none !important;
}

/* Settings Tab */
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.rate-option-card {
    position: relative;
}

.rate-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rate-option-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rate-option-card input[type="radio"]:checked + .rate-option-label {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.rate-option-label .rate-name {
    font-size: 13px;
    font-weight: 600;
}

.rate-option-label .rate-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.custom-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 6px;
}

.custom-input-wrapper input {
    padding: 8px 50px 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    background-color: #ffffff;
}

.custom-unit {
    position: absolute;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.sync-info-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sync-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.font-mono {
    font-family: monospace;
}

.text-green {
    color: var(--success);
    font-weight: 600;
}

.text-muted {
    color: var(--text-secondary);
}

.small {
    font-size: 11px;
}

.mt-4 {
    margin-top: 14px;
}

.text-center {
    text-align: center;
}

/* Bottom Navigation Menu - 6 Elements Fit */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px)) 6px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 0;
    border-radius: 8px;
}

.nav-item:active {
    background-color: var(--primary-light);
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: translateY(-1px);
}
