/* Estilos generales */
:root {
    --primary-color: #91c400;
    --secondary-color: #8b2e00;
    --text-color: #472d1e;
    --bg-color: #f8f0d7;
    --parchment-bg: #f6ebd3;
    --parchment-border: #d9bb8c;
    --shadow-color: rgba(71, 45, 30, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lora', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23e2d2b4' fill-opacity='0.3' fill-rule='evenodd'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--parchment-border);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 60px;
    height: 60px;
    margin-right: 15px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-name {
    font-weight: bold;
}

/* Botones */
.medieval-btn {
    background-color: var(--primary-color);
    color: white;
    font-family: 'Lora', serif;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-align: center;
}

.medieval-btn:hover {
    background-color: #7da803;
    transform: translateY(-2px);
}

.medieval-btn.green {
    background-color: var(--primary-color);
}

button {
    cursor: pointer;
}

/* Parchment (Pergamino) */
.parchment {
    background-color: var(--parchment-bg);
    border: 2px solid var(--parchment-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px var(--shadow-color);
    margin-bottom: 20px;
}

.section {
    margin-bottom: 30px;
}

/* Auth Forms */
.auth-container {
    max-width: 500px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background-color: #e2d2b4;
    border: none;
    border-bottom: 2px solid var(--parchment-border);
    font-family: 'Lora', serif;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: var(--parchment-bg);
    border-bottom: 2px solid var(--primary-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input {
    padding: 10px;
    border: 1px solid var(--parchment-border);
    border-radius: 4px;
    font-family: 'Lora', serif;
    background-color: rgba(255, 255, 255, 0.8);
}

.hidden {
    display: none !important;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 20px;
    text-align: center;
}

.welcome-message {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(145, 196, 0, 0.1);
    border-radius: 4px;
    font-style: italic;
}

/* Points display */
.points-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.medal {
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #d9bb8c, #e2d2b4);
    border-radius: 50%;
    border: 3px solid #8b6c42;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: var(--text-color);
    position: relative;
}

.medal::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid #c9a97c;
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
}

.medal #client-points {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.points-label {
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Progress bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar-container {
    margin-top: 15px;
}

.progress-bar {
    height: 20px;
    background-color: #e2d2b4;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.next-reward {
    text-align: right;
    font-size: 0.9rem;
    font-style: italic;
}

#next-reward-name {
    font-weight: bold;
}

/* Referral code */
.referral-container {
    margin-bottom: 30px;
}

.referral-code {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--parchment-border);
    border-radius: 4px;
}

#referral-code {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-right: 10px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Social share buttons */
.share-buttons h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.social-btn.whatsapp {
    background-color: #25D366;
}

.social-btn.facebook {
    background-color: #1877F2;
}

.social-btn.email {
    background-color: #EA4335;
}

/* Rewards list */
.rewards-container {
    margin-bottom: 30px;
}

.rewards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.reward-card {
    border: 1px solid var(--parchment-border);
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.reward-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.reward-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 1.2rem;
}

.reward-title {
    font-weight: bold;
}

.reward-description {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.reward-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.reward-points {
    font-weight: bold;
}

/* Activity history */
.activity-list {
    margin-top: 15px;
}

.activity-item {
    padding: 10px;
    border-bottom: 1px solid var(--parchment-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-date {
    font-size: 0.8rem;
    color: #777;
}

.activity-points {
    font-weight: bold;
}

.activity-points.positive {
    color: green;
}

.activity-points.negative {
    color: red;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--parchment-border);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--parchment-border);
}

.reward-details {
    margin-bottom: 20px;
}

.reward-cost {
    font-weight: bold;
    margin-top: 10px;
}

.reward-cost span {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.confirmation-message {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.success-icon {
    margin-bottom: 15px;
}

.redemption-code {
    text-align: center;
    margin-top: 20px;
}

.code-display {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 2px dashed var(--parchment-border);
    border-radius: 4px;
}

.code-instructions {
    font-size: 0.9rem;
    font-style: italic;
}

/* Restaurante Dashboard */
.assign-points-container {
    max-width: 600px;
    margin: 0 auto 30px;
}

.currency-input {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 10px;
    font-weight: bold;
}

.currency-input input {
    padding-left: 25px;
}

.calculated-points {
    margin: 15px 0;
    font-weight: bold;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background-color: var(--parchment-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    padding: 20px;
    background-color: var(--parchment-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.medieval-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.medieval-table th,
.medieval-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--parchment-border);
}

.medieval-table th {
    background-color: #e2d2b4;
    font-weight: 600;
}

.medieval-table tr:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Admin Dashboard */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--parchment-border);
}

.admin-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-family: 'Lora', serif;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.settings-section {
    margin-bottom: 30px;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--parchment-border);
    font-size: 0.9rem;
}

/* Error messages */
.error-message {
    color: red;
    padding: 10px;
    margin-bottom: 15px;
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 3px solid red;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
    
    .stats-container,
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .social-buttons {
        flex-wrap: wrap;
    }
    
    .admin-tabs {
        justify-content: center;
    }
}