/* =========================================
   VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    --primary: #2ecc71;
    --primary-hover: #27ae60;
    --dark: #2c3e50;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-muted: #7f8c8d;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   LAYOUT Y CONTENEDORES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* =========================================
   TIPOGRAFÍA Y HERO (INDEX)
   ========================================= */
h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -1px;
    text-align: center;
}

.hero-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    text-align: center;
}

/* =========================================
   BOTONES
   ========================================= */
.btn-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(46, 204, 113, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* =========================================
   TARJETAS Y FORMULARIOS (LOGIN/REGISTER)
   ========================================= */
.card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.card p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #eee;
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* =========================================
   FEATURES GRID (INDEX)
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 5rem;
    width: 100%;
}

.feature-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-item h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =========================================
   DASHBOARD (LISTA DE COMPRA)
   ========================================= */
.list-container {
    width: 100%;
    max-width: 500px;
}

.add-item-box {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.shopping-list {
    list-style: none;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.shopping-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    justify-content: space-between;
}

.shopping-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    margin-left: 10px;
}

.btn-delete {
    background: #ff7675;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

/* Responsivo */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .card { padding: 1.5rem; }
}

/* =========================================
   FOOTER STYLES
   ========================================= */
.main-footer {
    width: 100%;
    padding: 2rem 1rem;
    margin-top: auto; /* Empuja el footer al final si hay poco contenido */
    background-color: transparent;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sync-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    color: #95a5a6 !important; /* Un gris más suave */
}

.sync-icon {
    font-size: 1rem;
    animation: spin 8s linear infinite; /* Un giro muy lento casi imperceptible */
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Ajuste para que el footer no tape contenido en móviles */
@media (max-width: 600px) {
    .main-footer {
        padding: 1.5rem 1rem;
    }
}

.btn-ver{
    transition: 0.3s;
    background-color: 
    rgb(52, 178, 10); 
    border-radius: 10px; 
    color: white; 
    border: none; 
    padding: 10px 5px; 
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-ver:hover{
    font-size: 0.9rem;
    transition: 0.3s;
    filter: brightness(1.1);
    padding: 12px 8px;
}