/* ============================================================================
   COMPONENTS REUTILIZABLES - TINA Application
   Classes genèriques per maximitzar coherència visual i manteniment
   ============================================================================ */

/* CARDS - Estils base per a totes les targetes */
/* ========================================================================== */

.card-base {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-base:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Variacions específiques de cards */
.card-stat {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-alert {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-location {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-import {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Colors de cards estadístiques */
.card-stat-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.card-stat-success { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; }
.card-stat-warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.card-stat-danger { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); color: white; }
.card-stat-info { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); color: white; }

/* Colors de cards d'ubicació */
.card-location-fridge { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); color: white; }
.card-location-pantry { background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%); color: white; }
.card-location-freezer { background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%); color: white; }
.card-location-counter { background: linear-gradient(135deg, #55efc4 0%, #00b894 100%); color: white; }

/* Alertes específiques */
.card-alert-warning { border-left: 4px solid #f39c12; }
.card-alert-danger { border-left: 4px solid #e74c3c; }
.card-alert-success { border-left: 4px solid #27ae60; }

/* Botons - Estils base */
/* ========================================================================== */

.btn-base {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a6fd8; }
.btn-success { background: #43e97b; color: white; }
.btn-success:hover { background: #38f9d7; }
.btn-warning { background: #fdcb6e; color: white; }
.btn-warning:hover { background: #f39c12; }
.btn-danger { background: #ff6b6b; color: white; }
.btn-danger:hover { background: #ee5a24; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }
.btn-info { background: #74b9ff; color: white; }
.btn-info:hover { background: #0984e3; }

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Formularis - Estils base */
/* ========================================================================== */

.form-control-base {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control-base:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.form-group-base {
    margin-bottom: 1rem;
}

.form-group-base label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

/* Grid i layout */
/* ========================================================================== */

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

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

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

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

/* Taules - Estils base */
/* ========================================================================== */

.table-base {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table-base th,
.table-base td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table-base th {
    background: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.table-base tbody tr:hover {
    background: #f8f9fa;
}

.table-base tbody tr:last-child td {
    border-bottom: none;
}

/* Paginació */
/* ========================================================================== */

.pagination-base {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination-base a {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s ease-in-out;
}

.pagination-base a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-base .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Utilitats */
/* ========================================================================== */

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

/* Números i estadístiques */
/* ========================================================================== */

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.info-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* Headers de secció */
/* ========================================================================== */

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.section-header-finance {
    background: linear-gradient(45deg, #6f42c1, #5a32a3);
    color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-header-grocery {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

/* ============================================================================
   COMPONENTS ESPECÍFICS DE FINANCES - Mòdul Finance
   Classes específiques per al mòdul de finances mantenen la identitat visual púrpura
   ============================================================================ */

/* Categories de finances */
/* ========================================================================== */

.category-group {
    border-left: 4px solid #6f42c1;
    padding-left: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    padding: 15px;
}

.category-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.category-item:hover {
    background: #f8f9fa;
}

.category-ungrouped {
    border-left: 4px solid #6c757d;
}

/* Transaccions */
/* ========================================================================== */

.transaction-item {
    border-left: 4px solid #dee2e6;
    padding: 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.2s;
}

.transaction-item:hover {
    background: #e9ecef;
}

.transaction-income {
    border-left-color: #28a745;
}

.transaction-expense {
    border-left-color: #dc3545;
}

.filter-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Colors específics de finances */
.income-color {
    color: #28a745;
}

.expense-color {
    color: #dc3545;
}

/* Badges específics */
.account-badge {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Comptes bancaris */
/* ========================================================================== */

.account-header {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-radius: 8px 8px 0 0;
    padding: 1.5rem;
}

.balance-display {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Subscripcions */
/* ========================================================================== */

.subscription-header {
    background: linear-gradient(45deg, #6f42c1, #5a32a3);
    color: white;
    padding: 1.5rem;
}

.subscription-price {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.subscription-frequency {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Alertes de subscripcions */
.alert-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.billing-soon {
    background-color: #ffc107;
    color: #000;
}

.expiring-soon {
    background-color: #dc3545;
    color: white;
}

.inactive {
    background-color: #6c757d;
    color: white;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.active-badge {
    background-color: #28a745;
    color: white;
}

.days-until {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.days-urgent {
    color: #dc3545;
    font-weight: bold;
}

.days-warning {
    color: #ffc107;
    font-weight: bold;
}

.days-normal {
    color: #28a745;
}

/* Bancs */
/* ========================================================================== */

.search-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.bank-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.bank-table .table {
    margin-bottom: 0;
}

.bank-table .table th {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.bank-table .table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
}

.bank-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

.actions-buttons {
    white-space: nowrap;
}

.bank-code {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}