/* ============================================
   Goals (Metas) Page Styles
   ============================================ */

.metas-page {
    max-width: 800px;
    padding-bottom: 100px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    flex: 1;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

.btn-header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-header-action:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-header-action i {
    width: 20px;
    height: 20px;
}

/* Summary Hero Card */
.summary-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(59, 130, 246, 0.3);
}

.summary-hero-content {
    margin-bottom: 1.25rem;
}

.summary-hero-label {
    font-size: 0.8125rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-hero-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.summary-hero-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
}

.progress-bar-hero {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill-hero {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text-hero {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.summary-hero-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.filter-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab i {
    width: 18px;
    height: 18px;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Goals Grid */
.metas-grid {
    display: grid;
    gap: 1rem;
}

/* Goal Card */
.goal-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
}

.goal-card:hover {
    box-shadow: var(--shadow-md);
}

.goal-card.completed {
    opacity: 0.7;
}

.goal-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.goal-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.goal-icon i {
    width: 24px;
    height: 24px;
    color: white;
}

.goal-info {
    flex: 1;
    min-width: 0;
}

.goal-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.goal-deadline {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.goal-deadline i {
    width: 14px;
    height: 14px;
}

.goal-deadline.urgent {
    color: var(--danger);
}

.goal-actions {
    display: flex;
    gap: 0.25rem;
}

.goal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.goal-action-btn i {
    width: 16px;
    height: 16px;
}

.goal-action-btn:hover {
    background: var(--hover-bg);
}

.goal-action-btn.add:hover {
    color: var(--success);
}

.goal-action-btn.edit:hover {
    color: var(--primary);
}

.goal-action-btn.delete:hover {
    color: var(--danger);
}

.goal-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.progress-current {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-target {
    color: var(--text-secondary);
}

.goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.goal-percentage {
    font-size: 1.25rem;
    font-weight: 700;
}

.goal-remaining {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.goal-completed-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.goal-completed-badge i {
    width: 16px;
    height: 16px;
}

/* Priority Indicator */
.priority-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.priority-1 { background: var(--gray-300); }
.priority-2 { background: var(--info); }
.priority-3 { background: var(--primary); }
.priority-4 { background: var(--warning); }
.priority-5 { background: var(--danger); }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state > i {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 300px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 4px 12px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 90;
}

.fab i {
    width: 24px;
    height: 24px;
}

.fab:hover {
    transform: scale(1.05);
}

@supports (bottom: env(safe-area-inset-bottom)) {
    .fab {
        bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Modal Styles */
.modal-small {
    max-width: 400px;
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
}

.delete-warning {
    text-align: center;
}

.delete-warning i {
    width: 48px;
    height: 48px;
    color: var(--warning);
    margin-bottom: 1rem;
}

.delete-warning p {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.delete-warning .text-muted {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Contribute Goal Info */
.contribute-goal-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin: 0 1.5rem 1rem;
}

.contribute-goal-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.contribute-goal-icon i {
    width: 22px;
    height: 22px;
    color: white;
}

.contribute-goal-details {
    flex: 1;
}

.contribute-goal-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.contribute-goal-progress {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Icon Selector */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    max-height: 160px;
    overflow-y: auto;
}

.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-option i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.icon-option:hover {
    border-color: var(--border-color);
}

.icon-option.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.icon-option.active i {
    color: var(--primary);
}

/* Color Options */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-option {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--card-bg);
}

/* Account Badge on Goal Card */
.goal-account-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.goal-account-badge i {
    width: 12px;
    height: 12px;
}

/* Transfer Info in Contribute Modal */
.contribute-transfer-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 6px;
    margin-top: 0.5rem;
}

.contribute-transfer-info i {
    width: 14px;
    height: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Form Hint */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .summary-hero {
        padding: 1.25rem;
    }

    .summary-hero-value {
        font-size: 1.75rem;
    }

    .summary-hero-stats {
        gap: 1rem;
    }

    .hero-stat-value {
        font-size: 1.25rem;
    }

    .goal-card-header {
        flex-wrap: wrap;
    }

    .goal-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .icon-selector {
        grid-template-columns: repeat(5, 1fr);
    }

    .fab {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}
