/**
 * Estilos públicos para Lista de Regalos
 * 
 * Estos estilos están diseñados para heredar los colores y tipografías del tema
 * utilizando variables CSS y estilos discretos
 */

/* Variables CSS - heredan del tema cuando es posible */
:root {
    --lr-primary-color: var(--theme-primary, #2c3e50);
    --lr-secondary-color: var(--theme-secondary, #95a5a6);
    --lr-success-color: #27ae60;
    --lr-danger-color: #e74c3c;
    --lr-warning-color: #f39c12;
    --lr-border-color: #ddd;
    --lr-border-radius: 8px;
    --lr-box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --lr-transition: all 0.3s ease;
}

/* Reset básico */
.lista-regalos-archive *,
.lista-regalos-single *,
.lista-regalos-create *,
.lista-regalos-edit *,
.lista-regalos-my-lists * {
    box-sizing: border-box;
}

/* Botones - heredan estilos del tema */
.lr-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--lr-border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: var(--lr-transition);
    font-size: inherit;
    font-family: inherit;
    text-align: center;
    line-height: 1.5;
}

.lr-button-primary {
    background-color: var(--lr-primary-color);
    color: #fff;
}

.lr-button-primary:hover {
    opacity: 0.9;
    color: #fff;
}

.lr-button-secondary {
    background-color: var(--lr-secondary-color);
    color: #fff;
}

.lr-button-secondary:hover {
    opacity: 0.9;
    color: #fff;
}

.lr-button-danger {
    background-color: var(--lr-danger-color);
    color: #fff;
}

.lr-button-danger:hover {
    opacity: 0.9;
}

.lr-button-white {
    background-color: #fff;
    color: var(--lr-primary-color);
}

.lr-button-white:hover {
    background-color: #f8f8f8;
}

.lr-button-large {
    padding: 15px 30px;
    font-size: 1.1em;
}

.lr-button-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.lr-button-block {
    display: block;
    width: 100%;
}

.lr-button-disabled,
.lr-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botón agregar a lista en productos */
.lista-regalos-add-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--lr-primary-color);
    color: var(--lr-primary-color);
    border-radius: var(--lr-border-radius);
    cursor: pointer;
    transition: var(--lr-transition);
    font-size: 0.95em;
}

.lista-regalos-add-button:hover {
    background: var(--lr-primary-color);
    color: #fff;
}

.lista-regalos-add-button-single {
    margin-top: 15px;
    width: 100%;
    justify-content: center;
}

/* Archivo de listas */
.lr-archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.lr-lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.lr-list-card {
    background: #fff;
    border-radius: var(--lr-border-radius);
    box-shadow: var(--lr-box-shadow);
    overflow: hidden;
    transition: var(--lr-transition);
}

.lr-list-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lr-list-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.lr-list-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--lr-transition);
}

.lr-list-card:hover .lr-list-card-overlay {
    opacity: 1;
}

.lr-list-card-content {
    padding: 20px;
    position: relative;
}

.lr-list-card-profile {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: -50px auto 15px;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lr-list-card-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lr-list-card-title {
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.lr-list-card-title a {
    color: inherit;
    text-decoration: none;
}

.lr-list-card-owner,
.lr-list-card-date {
    text-align: center;
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

.lr-list-card-description {
    margin: 15px 0;
    color: #555;
    font-size: 0.95em;
}

.lr-list-card-progress {
    margin: 15px 0;
}

.lr-list-card-meta {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid var(--lr-border-color);
    font-size: 0.9em;
    color: #666;
}

/* Barra de progreso */
.lr-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.lr-progress-bar-large {
    height: 12px;
}

.lr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lr-success-color) 0%, #2ecc71 100%);
    transition: width 0.5s ease;
}

.lr-progress-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

/* Vista individual de lista */
.lr-cover {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 80px;
}

.lr-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}

.lr-edit-cover-btn {
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--lr-border-radius);
    cursor: pointer;
}

.lr-single-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.lr-profile-section {
    display: flex;
    gap: 20px;
    flex: 1;
}

.lr-profile-image-wrapper {
    position: relative;
    margin-top: -100px;
}

.lr-profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: var(--lr-box-shadow);
    object-fit: cover;
}

.lr-edit-profile-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--lr-primary-color);
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.lr-profile-info {
    flex: 1;
}

.lr-single-title {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.lr-single-owner {
    margin: 5px 0;
    color: #666;
}

.lr-single-date {
    margin: 5px 0;
    color: #666;
}

.lr-single-description {
    margin: 15px 0;
    color: #555;
}

.lr-single-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.lr-progress-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: var(--lr-border-radius);
    margin-bottom: 30px;
}

.lr-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Items de la lista */
.lr-section-title {
    margin: 30px 0 20px 0;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lr-item-count {
    color: #999;
    font-size: 0.7em;
}

.lr-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.lr-item-card {
    background: #fff;
    border: 1px solid var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    overflow: hidden;
    transition: var(--lr-transition);
    position: relative;
}

.lr-item-card:hover {
    box-shadow: var(--lr-box-shadow);
}

.lr-item-purchased {
    opacity: 0.7;
}

.lr-purchased-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--lr-success-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 1;
}

.lr-item-image {
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.lr-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--lr-transition);
}

.lr-item-card:hover .lr-item-image img {
    transform: scale(1.05);
}

.lr-item-content {
    padding: 15px;
}

.lr-item-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.lr-item-title a {
    color: inherit;
    text-decoration: none;
}

.lr-item-price {
    color: var(--lr-primary-color);
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.lr-item-quantity,
.lr-item-note {
    margin: 8px 0;
    font-size: 0.9em;
    color: #666;
}

.lr-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.lr-item-actions .lr-button {
    flex: 1;
    font-size: 0.9em;
}

/* Mensajes */
.lr-messages-section {
    margin-top: 40px;
}

.lr-messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lr-message-card {
    background: #fff;
    border: 1px solid var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    padding: 15px;
}

.lr-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lr-border-color);
}

.lr-message-date {
    color: #999;
    font-size: 0.9em;
}

.lr-message-content {
    color: #555;
    line-height: 1.6;
}

/* Formularios */
.lr-form {
    max-width: 700px;
    margin: 0 auto;
}

.lr-form-group {
    margin-bottom: 20px;
}

.lr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.lr-input,
.lr-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    font-size: inherit;
    font-family: inherit;
}

.lr-input:focus,
.lr-textarea:focus {
    outline: none;
    border-color: var(--lr-primary-color);
}

.lr-help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.lr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.lr-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.lr-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.lr-message {
    padding: 15px;
    border-radius: var(--lr-border-radius);
    margin-top: 20px;
}

.lr-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lr-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Upload de imágenes */
.lr-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lr-image-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    overflow: hidden;
}

.lr-image-preview-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.lr-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mis Listas */
.lr-my-lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.lr-my-lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.lr-my-list-card {
    background: #fff;
    border-radius: var(--lr-border-radius);
    box-shadow: var(--lr-box-shadow);
    overflow: hidden;
}

.lr-my-list-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.lr-my-list-status {
    position: absolute;
    top: 10px;
    right: 10px;
}

.lr-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.lr-badge-success {
    background: var(--lr-success-color);
    color: #fff;
}

.lr-badge-secondary {
    background: var(--lr-secondary-color);
    color: #fff;
}

.lr-my-list-content {
    padding: 20px;
}

.lr-my-list-title {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.lr-my-list-date {
    margin: 5px 0 15px 0;
    color: #666;
    font-size: 0.9em;
}

.lr-my-list-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.lr-stat {
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: var(--lr-border-radius);
}

.lr-stat strong {
    display: block;
    font-size: 1.5em;
    color: var(--lr-primary-color);
}

.lr-stat span {
    font-size: 0.85em;
    color: #666;
}

.lr-my-list-progress {
    margin: 15px 0;
}

.lr-my-list-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.lr-my-list-actions .lr-button {
    flex: 1;
}

/* Estado vacío */
.lr-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.lr-empty-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
}

.lr-empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.lr-empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Modal */
.lr-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.lr-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--lr-border-radius);
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lr-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.lr-modal-close:hover {
    color: #000;
}

.lr-modal-title {
    margin: 0 0 20px 0;
}

.lr-modal-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.lr-modal-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--lr-border-color);
}

.lr-modal-divider span {
    background: #fff;
    padding: 0 15px;
    position: relative;
    z-index: 1;
    color: #999;
}

/* Lista de opciones en modal */
.lr-lists-select {
    max-height: 300px;
    overflow-y: auto;
}

.lr-list-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    margin-bottom: 10px;
    transition: var(--lr-transition);
}

.lr-list-option:hover {
    background: #f9f9f9;
}

.lr-list-option-content strong {
    display: block;
    margin-bottom: 5px;
}

.lr-list-option-content small {
    color: #666;
}

.lr-share-input-group {
    display: flex;
    gap: 10px;
}

.lr-share-input-group input {
    flex: 1;
}

.lr-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.lr-success-message {
    background: var(--lr-success-color);
    color: #fff;
    padding: 15px;
    border-radius: var(--lr-border-radius);
    margin-bottom: 15px;
    text-align: center;
}

/* Sistema de cantidades y carrito */
.lr-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lr-bulk-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.lr-item-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.lr-item-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.lr-partial-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--lr-warning-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 1;
}

.lr-item-quantity-info {
    margin: 10px 0;
}

.lr-quantity-bar {
    margin-bottom: 8px;
}

.lr-quantity-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
}

.lr-progress-bar-small {
    height: 6px;
}

.lr-quantity-remaining {
    font-size: 0.85em;
    color: var(--lr-warning-color);
    font-weight: 600;
}

.lr-add-to-cart-group {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.lr-quantity-input {
    width: 60px;
    padding: 8px;
    border: 1px solid var(--lr-border-color);
    border-radius: var(--lr-border-radius);
    text-align: center;
    font-size: 14px;
}

.lr-quantity-input:focus {
    outline: none;
    border-color: var(--lr-primary-color);
}

.lr-add-to-cart-group .lr-button {
    flex: 1;
    margin: 0;
}

.lr-cart-success {
    background: var(--lr-success-color);
    color: #fff;
    padding: 10px 15px;
    border-radius: var(--lr-border-radius);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lr-modal-quantity-group {
    margin-bottom: 20px;
}

.lr-modal-quantity-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.lr-modal-quantity-group input {
    width: 100px;
}

/* Estilos para items seleccionados */
.lr-item-card:has(.lr-item-select:checked) {
    border: 2px solid var(--lr-primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .lr-lists-grid,
    .lr-items-grid,
    .lr-my-lists-grid {
        grid-template-columns: 1fr;
    }
    
    .lr-single-header {
        flex-direction: column;
    }
    
    .lr-profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .lr-single-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .lr-form-row {
        grid-template-columns: 1fr;
    }
    
    .lr-cover {
        height: 200px;
        margin-bottom: 60px;
    }
    
    .lr-profile-image {
        width: 100px;
        height: 100px;
    }
    
    .lr-profile-image-wrapper {
        margin-top: -70px;
    }
    
    .lr-modal-content {
        margin: 10% 20px;
        padding: 20px;
    }
    
    .lr-items-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lr-bulk-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .lr-bulk-actions .lr-button {
        width: 100%;
    }
    
    .lr-add-to-cart-group {
        flex-direction: column;
    }
    
    .lr-quantity-input {
        width: 100%;
    }
}

