/* WooCommerce Tribute System Styles */

/* Tribute Request Form */
.wc-tribute-request-form {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wc-tribute-request-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
}

.wc-tribute-request-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.wc-tribute-request-form select,
.wc-tribute-request-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.wc-tribute-request-form select:focus,
.wc-tribute-request-form textarea:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 1px #96588a;
}

.wc-tribute-request-form textarea {
    resize: vertical;
    min-height: 100px;
}

.wc-tribute-request-form p {
    margin-bottom: 15px;
}

.wc-tribute-request-form button {
    background: #96588a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.wc-tribute-request-form button:hover {
    background: #7a4670;
}

/* My Tribute Requests Table */
.wc-tribute-my-requests {
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wc-tribute-my-requests h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
}

.wc-tribute-my-requests table {
    width: 100%;
    border-collapse: collapse;
}

.wc-tribute-my-requests th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.wc-tribute-my-requests td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.wc-tribute-my-requests tr:hover {
    background: #fafafa;
}

/* Status badges */
.tribute-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.tribute-status.status-active {
    background: #d4edda;
    color: #155724;
}

.tribute-status.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Cancel button */
.tribute-cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
}

.tribute-cancel-btn:hover {
    background: #c82333;
}

.tribute-no-action {
    color: #999;
    font-style: italic;
}

/* Responsive table */
@media (max-width: 768px) {
    .wc-tribute-my-requests table {
        border: 0;
    }
    
    .wc-tribute-my-requests thead {
        display: none;
    }
    
    .wc-tribute-my-requests tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }
    
    .wc-tribute-my-requests td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
    }
    
    .wc-tribute-my-requests td:before {
        content: attr(data-title);
        float: left;
        font-weight: 600;
        color: #555;
    }
    
    .tribute-cancel-btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* Tribute Gallery */
.wc-tribute-gallery {
    margin: 20px 0;
}

.tribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .tribute-grid {
        grid-template-columns: 1fr;
    }
}

/* Tribute Card */
.tribute-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tribute-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.tribute-avatar {
    text-align: center;
    margin-bottom: 15px;
}

.tribute-avatar img {
    border-radius: 50%;
    border: 3px solid #96588a;
    width: 80px;
    height: 80px;
}

.tribute-info {
    text-align: center;
    margin-bottom: 20px;
}

.tribute-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.3em;
}

.tribute-occasion {
    color: #96588a;
    font-weight: 600;
    margin: 5px 0;
    font-size: 1.1em;
}

.tribute-date {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.tribute-user-message {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-style: italic;
    color: #555;
    border-left: 3px solid #96588a;
}

/* Tribute Actions */
.tribute-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tribute-actions button {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    background: #96588a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease, transform 0.1s ease;
}

.tribute-actions button:hover {
    background: #7a4670;
    transform: scale(1.02);
}

.tribute-actions button:active {
    transform: scale(0.98);
}

/* Tribute Messages Section */
.tribute-messages {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    margin-top: 15px;
}

.tribute-messages h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 1.1em;
}

.tribute-message-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.message-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.message-content {
    flex: 1;
}

.message-content strong {
    color: #333;
    font-size: 0.95em;
}

.message-content p {
    margin: 5px 0;
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}

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

/* Modal Styles */
.tribute-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tribute-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tribute-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.tribute-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: color 0.3s ease;
}

.tribute-modal-close:hover {
    color: #333;
}

.tribute-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.tribute-modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.tribute-modal-form input[type="number"],
.tribute-modal-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.tribute-modal-form textarea {
    resize: vertical;
    min-height: 100px;
}

.tribute-modal-form input:focus,
.tribute-modal-form textarea:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 1px #96588a;
}

.tribute-modal-form button[type="submit"] {
    background: #96588a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background 0.3s ease;
}

.tribute-modal-form button[type="submit]:hover {
    background: #7a4670;
}

.tribute-modal-form button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading State */
.tribute-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.tribute-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

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

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

/* Empty State */
.tribute-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.tribute-empty p {
    font-size: 1.1em;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .tribute-actions {
        flex-direction: column;
    }
    
    .tribute-actions button {
        width: 100%;
    }
    
    .tribute-modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Accessibility */
.tribute-card:focus-within,
.tribute-actions button:focus,
.wc-tribute-request-form button:focus {
    outline: 2px solid #96588a;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .tribute-actions,
    .tribute-modal {
        display: none !important;
    }
}

/* Tribute Leaderboard Styles */
.wc-tribute-leaderboard {
    margin: 30px 0;
}

.wc-tribute-leaderboard h3 {
    color: #333;
    font-size: 1.6em;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.wc-tribute-leaderboard h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #96588a, #7a4670);
}

/* Dual Leaderboard Layout */
.leaderboard-dual {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 968px) {
    .leaderboard-dual {
        grid-template-columns: 1fr;
    }
}

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

/* Leaderboard Table */
.tribute-leaderboard-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-row:hover {
    background: #f9f9f9;
    transform: translateX(4px);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

/* Top 3 Ranks Special Styling */
.leaderboard-row.rank-gold {
    background: linear-gradient(90deg, #fff9e6 0%, #ffffff 100%);
    border-left: 4px solid #FFD700;
}

.leaderboard-row.rank-silver {
    background: linear-gradient(90deg, #f5f5f5 0%, #ffffff 100%);
    border-left: 4px solid #C0C0C0;
}

.leaderboard-row.rank-bronze {
    background: linear-gradient(90deg, #fff4ed 0%, #ffffff 100%);
    border-left: 4px solid #CD7F32;
}

/* Current User Highlight */
.leaderboard-row.current-user {
    background: linear-gradient(90deg, #f0e6ff 0%, #ffffff 100%);
    border: 2px solid #96588a;
    font-weight: 600;
}

/* Rank Number/Medal */
.rank-number {
    min-width: 60px;
    text-align: center;
    font-size: 1.4em;
}

.rank-medal {
    font-size: 2em;
    display: inline-block;
    animation: medalShine 2s ease-in-out infinite;
}

@keyframes medalShine {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.rank-text {
    font-weight: 700;
    color: #666;
    font-size: 1.2em;
}

/* Avatar */
.leaderboard-avatar {
    margin-right: 15px;
}

.leaderboard-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: 2px solid #e0e0e0;
}

.leaderboard-row.rank-gold .leaderboard-avatar img {
    border-color: #FFD700;
}

.leaderboard-row.rank-silver .leaderboard-avatar img {
    border-color: #C0C0C0;
}

.leaderboard-row.rank-bronze .leaderboard-avatar img {
    border-color: #CD7F32;
}

/* User Info */
.leaderboard-info {
    flex: 1;
}

.user-name {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-badge {
    background: #96588a;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.user-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.points-count {
    font-weight: 600;
    color: #96588a;
}

.transaction-count {
    color: #999;
}

/* Achievement Badges */
.leaderboard-badge {
    margin-left: auto;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.badge-legendary {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.badge-platinum {
    background: linear-gradient(135deg, #E5E4E2, #BCC6CC);
    color: #333;
    box-shadow: 0 2px 8px rgba(188, 198, 204, 0.4);
}

.badge-gold {
    background: linear-gradient(135deg, #FFD700, #FFED4E);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.badge-silver {
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8);
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}

.badge-bronze {
    background: linear-gradient(135deg, #CD7F32, #E9967A);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.badge-novice {
    background: linear-gradient(135deg, #90EE90, #98FB98);
    color: #2d5016;
    box-shadow: 0 2px 8px rgba(144, 238, 144, 0.3);
}

/* Empty State */
.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* Responsive Leaderboard */
@media (max-width: 768px) {
    .leaderboard-row {
        flex-wrap: wrap;
        padding: 12px 15px;
    }
    
    .rank-number {
        min-width: 50px;
    }
    
    .leaderboard-badge {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    .badge {
        display: block;
        text-align: center;
    }
    
    .user-stats {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .leaderboard-avatar {
        margin-right: 10px;
    }
    
    .leaderboard-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .user-name {
        font-size: 1em;
    }
    
    .rank-medal {
        font-size: 1.5em;
    }
}