/**
 * Cooperativa Agrícola d'Alforja - Frontend Styles
 */

:root {
    --coop-green: #4a7c59;
    --coop-green-dark: #3d6549;
    --coop-green-light: #e8f0ea;
    --coop-gold: #d4a84b;
    --coop-brown: #8b7355;
    --coop-cream: #f5f5f0;
}

/* Portal del Soci */
.coop-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.coop-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--coop-green), var(--coop-green-dark));
    color: white;
    border-radius: 16px;
    margin-bottom: 20px;
}

.coop-portal-welcome h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.coop-soci-info {
    opacity: 0.9;
    margin: 0;
}

.coop-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.coop-campanya-banner {
    background: var(--coop-gold);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Stats */
.coop-portal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.coop-stat {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #eee;
}

.coop-stat-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.coop-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--coop-green);
}

.coop-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.coop-stat-highlight {
    background: linear-gradient(135deg, var(--coop-gold), #c49a3e);
    color: white;
}

.coop-stat-highlight .coop-stat-value {
    color: white;
}

.coop-stat-highlight .coop-stat-label {
    color: rgba(255,255,255,0.9);
}

/* Seccions */
.coop-portal-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.coop-portal-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.coop-portal-section h3 {
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--coop-green-light);
    color: #333;
}

.coop-portal-full-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.coop-portal-full-section h3 {
    margin: 0 0 20px 0;
}

/* Taules */
.coop-table {
    width: 100%;
    border-collapse: collapse;
}

.coop-table th {
    background: var(--coop-green-light);
    color: var(--coop-green-dark);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coop-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.coop-table th:last-child {
    border-radius: 0 8px 8px 0;
}

.coop-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.coop-table tr:hover td {
    background: #fafafa;
}

.coop-table .text-right {
    text-align: right;
}

/* Badges d'estat */
.coop-badge-success {
    background: #d4edda;
    color: #155724;
}

.coop-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.coop-badge-error {
    background: #f8d7da;
    color: #721c24;
}

/* Botons */
.coop-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

.coop-btn-primary:hover {
    background: var(--coop-green-dark);
    color: white;
}

.coop-btn-secondary {
    background: #eee;
    color: #333;
}

.coop-btn-secondary:hover {
    background: #ddd;
}

.coop-btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Links */
.coop-link {
    color: var(--coop-green);
    text-decoration: none;
    font-weight: 500;
}

.coop-link:hover {
    text-decoration: underline;
}

/* Alertes */
.coop-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.coop-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.coop-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.coop-alert a {
    color: inherit;
    font-weight: 600;
}

/* No data */
.coop-no-data {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Login Form */
.coop-login-form {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.coop-login-form h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--coop-green);
    font-size: 24px;
}

.coop-login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.coop-login-form input[type="text"],
.coop-login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
}

.coop-login-form input[type="text"]:focus,
.coop-login-form input[type="password"]:focus {
    border-color: var(--coop-green);
    outline: none;
}

.coop-login-form input[type="submit"] {
    width: 100%;
    background: var(--coop-green);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.coop-login-form input[type="submit"]:hover {
    background: var(--coop-green-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .coop-portal-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .coop-portal-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .coop-portal-sections {
        grid-template-columns: 1fr;
    }
    
    .coop-table {
        font-size: 14px;
    }
    
    .coop-table th,
    .coop-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .coop-portal {
        padding: 10px;
    }
    
    .coop-portal-stats {
        grid-template-columns: 1fr;
    }
    
    .coop-stat {
        padding: 16px;
    }
    
    .coop-stat-value {
        font-size: 24px;
    }
}
