/**
 * Frontend Styles for Creator Wishlist Platform
 */

/* ===========================================
   Wishlist Button Styles
   =========================================== */

.cwp-wishlist-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    margin: 10px 0;
    background: #fff;
    border: 2px solid #e74c3c;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cwp-wishlist-button:hover {
    background: #e74c3c;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.cwp-wishlist-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cwp-wishlist-button.cwp-remove-wishlist {
    background: #e74c3c;
    color: #fff;
}

.cwp-wishlist-button.cwp-remove-wishlist:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* Loop button - compact version */
.cwp-wishlist-button-loop {
    padding: 8px;
    border-radius: 50%;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    margin: 5px 0;
}

.cwp-wishlist-button-loop .cwp-button-text {
    display: none;
}

/* Icons */
.cwp-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
}

.cwp-icon-heart-outline::before {
    content: "♡";
    font-size: 20px;
    line-height: 1;
}

.cwp-icon-heart-filled::before {
    content: "♥";
    font-size: 20px;
    line-height: 1;
}

/* ===========================================
   Wishlist Container Styles
   =========================================== */

.cwp-wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cwp-wishlist-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.cwp-wishlist-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.cwp-wishlist-description {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* ===========================================
   Wishlist Grid
   =========================================== */

.cwp-wishlist-items {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.cwp-wishlist-items.cwp-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cwp-wishlist-items.cwp-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cwp-wishlist-items.cwp-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .cwp-wishlist-items.cwp-columns-4,
    .cwp-wishlist-items.cwp-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .cwp-wishlist-items {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   Wishlist Item Card
   =========================================== */

.cwp-wishlist-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.cwp-wishlist-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.cwp-item-image {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.cwp-item-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.cwp-wishlist-item:hover .cwp-item-image img {
    transform: scale(1.05);
}

.cwp-item-details {
    padding: 20px;
}

.cwp-item-title {
    font-size: 18px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.cwp-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cwp-item-title a:hover {
    color: #e74c3c;
}

.cwp-item-price {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 12px;
}

.cwp-item-notes {
    background: #f8f8f8;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.cwp-item-notes strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.cwp-item-quantity {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}

.cwp-item-actions {
    margin-top: 15px;
}

.cwp-gift-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cwp-gift-button:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
    color: #fff;
}

/* Item admin controls */
.cwp-item-admin {
    padding: 12px 20px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.cwp-remove-item {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.cwp-remove-item:hover {
    background: #c0392b;
}

/* ===========================================
   My Wishlist (Management)
   =========================================== */

.cwp-my-wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cwp-wishlist-stats {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

.cwp-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.cwp-wishlist-table th {
    background: #f8f8f8;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.cwp-wishlist-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.cwp-product-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cwp-product-cell img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cwp-product-info a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.cwp-product-info a:hover {
    color: #e74c3c;
}

.cwp-actions-cell {
    text-align: right;
}

/* ===========================================
   Wishlist Share Section
   =========================================== */

.cwp-wishlist-share {
    background: #f8f8f8;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    text-align: center;
}

.cwp-wishlist-share h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
}

.cwp-share-url {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.cwp-share-url input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cwp-copy-url {
    padding: 12px 24px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.cwp-copy-url:hover {
    background: #2980b9;
}

/* ===========================================
   Notices
   =========================================== */

.cwp-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.cwp-notice-visible {
    opacity: 1;
    transform: translateX(0);
}

.cwp-notice-success {
    background: #27ae60;
}

.cwp-notice-error {
    background: #e74c3c;
}

.cwp-notice-info {
    background: #3498db;
}

/* ===========================================
   Gift Notice (Thank You Page)
   =========================================== */

.cwp-gift-notice {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.cwp-gift-notice strong {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 768px) {
    .cwp-wishlist-table {
        font-size: 14px;
    }

    .cwp-product-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .cwp-share-url {
        flex-direction: column;
    }

    .cwp-notice {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

/* ===========================================
   Cart Item Gift Indicator
   =========================================== */

.woocommerce-cart-form .cwp-gift-indicator {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ===========================================
   Loading State
   =========================================== */

.cwp-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.cwp-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e74c3c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cwp-spin 0.8s linear infinite;
}

@keyframes cwp-spin {
    to { transform: rotate(360deg); }
}
