/**
 * TIRI Airdrop & Rewards - Dashboard Styles
 * Version: 3.1.0
 * Last Updated: 2025-04-28
 * 
 * This file contains styles for the user-facing dashboard,
 * including both the React version and the PHP-rendered version.
 */

/*--------------------------------------------------------------
# Dashboard Container
--------------------------------------------------------------*/
.tiri-dashboard-card {
    max-width: 800px;
    margin: 20px auto;
    padding: 5px;
    font-family: 'Barlow Condensed', var(--tiri-font-family);
    font-size: 16px;
    font-weight: 300;
    color: var(--tiri-text-color);
}

.tiri-dashboard-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

/*--------------------------------------------------------------
# Dashboard Cards
--------------------------------------------------------------*/
.tiri-card {
    border: 1px solid var(--tiri-border-color);
    border-radius: var(--tiri-border-radius);
    padding: 15px 20px 30px 20px;
    margin-bottom: 30px;
    background: var(--tiri-card-bg-color);
    box-shadow: var(--tiri-card-shadow);
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    opacity: 0;
}

.tiri-card h3 {
    margin-top: 0;
    color: var(--tiri-text-color);
    font-size: 25px;
    font-weight: 600;
}

.tiri-card:nth-child(1) { --animation-order: 1; }
.tiri-card:nth-child(2) { --animation-order: 2; }
.tiri-card:nth-child(3) { --animation-order: 3; }
.tiri-card:nth-child(4) { --animation-order: 4; }
.tiri-card:nth-child(5) { --animation-order: 5; }
.tiri-card:nth-child(6) { --animation-order: 6; }

/*--------------------------------------------------------------
# Points Display
--------------------------------------------------------------*/
.tiri-points-wrapper {
    margin-bottom: 15px;
}

.tiri-points-display {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

.tiri-points-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--tiri-text-color);
}

.tiri-points-target {
    font-size: 18px;
    color: var(--tiri-text-muted);
    margin-left: 5px;
}

.tiri-progress {
    background: var(--tiri-primary-color);
    height: 100%;
    width: 0;
    transition: width 0.5s ease;
}

.tiri-progress-bar {
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    height: 10px;
    margin-top: 10px;
}

.tiri-progress {
    background: var(--tiri-primary-color);
    height: 100%;
    width: 0; /* Start at 0 width */
    transition: width 1.2s ease-out; /* Smooth animation */
}

/* Add class that will be applied when in viewport */
.tiri-progress.animate {
    width: var(--progress-width, 100%); /* Use variable or default to 100% */
}

/*--------------------------------------------------------------
# Task List
--------------------------------------------------------------*/
.tiri-task-summary {
    margin-bottom: 20px;
}

.tiri-task-completion {
	margin-bottom: 10px;
	font-weight: 500;
	font-size: 16px;
	color: var(--tiri-text-color);
}

.tiri-task-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.tiri-task-table td {
    padding: 0.5em;
    vertical-align: middle;
}

.tiri-task-table tr {
    border-bottom: 1px solid var(--tiri-border-color);
    position: relative;
}

.tiri-task-table tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

body.tiri-dark-mode .tiri-task-table tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.tiri-task-left {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1em;
    color: var(--tiri-text-color);
}

.tiri-task-left svg {
    flex-shrink: 0;
}

.tiri-task-label {
    flex-grow: 1;
}

.tiri-task-right {
    text-align: right;
    width: 2.5em;
    padding: 5px !important;
}

.tiri-task-right svg {
    margin-bottom: -4px;
}

.tiri-task-points {
    font-size: 14px;
    color: var(--tiri-primary-color);
    font-weight: 300;
    white-space: nowrap;
}

.task-completed .task-check {
    color: var(--tiri-success-color);
}

.task-pending .task-cross {
    color: var(--tiri-error-color);
}

/* Task Tooltips */
.tiri-task-table tr[title] {
    position: relative;
    cursor: help;
}

.tiri-task-table tr[title]:hover::after,
.tiri-task-table tr[title]:focus-within::after {
    content: attr(title);
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 4px 8px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 15px;
    z-index: 10;
    pointer-events: none;
}

.tiri-task-table tr[title]:hover::before,
.tiri-task-table tr[title]:focus-within::before {
    content: '';
    position: absolute;
    top: -0px;
    left: 10px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0,0,0,0.75) transparent transparent transparent;
    z-index: 11;
    pointer-events: none;
}

/*--------------------------------------------------------------
# Wallet Status
--------------------------------------------------------------*/
.tiri-wallet-status {
    background-color: var(--tiri-header-bg-color);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.tiri-wallet-connected {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tiri-wallet-address {
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
}

.tiri-token-balance {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tiri-token-amount {
    font-weight: 600;
    color: var(--tiri-text-color);
}

.tiri-token-symbol {
    color: var(--tiri-text-muted);
}

.tiri-wallet-disconnected {
    color: var(--tiri-error-color);
}

/* Wallet connection button animation */
@keyframes walletPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

#connect-wallet:not(:disabled) {
    animation: walletPulse 2s infinite;
}

/*--------------------------------------------------------------
# Referral Section
--------------------------------------------------------------*/
.tiri-referral-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.tiri-referral-label {
    color: var(--tiri-text-muted);
    margin-right: 5px;
}

.tiri-referral-value {
    font-weight: 600;
    color: var(--tiri-text-color);
}

.tiri-referral-link-container {
    display: flex;
    gap: 10px;
}

#tiri-referral-link {
    width: calc(100% - 113px);
    padding: 8px 10px;
    margin-right: 10px;
    font-size: inherit;
    border-radius: 5px;
    line-height: 20px;
    font-weight: inherit;
    border: 1px solid var(--tiri-border-color);
    background-color: var(--tiri-background-color);
    color: var(--tiri-text-color);
    height: 40px;
    margin-top: 15px;
}

#copy-referral {
    min-width: 100px;
    text-align: center;
    margin-right: 0 !important;
}

/*--------------------------------------------------------------
# Social Media Buttons
--------------------------------------------------------------*/
.tiri-social-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--tiri-border-color);
    background-color: var(--tiri-card-bg-color);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--tiri-text-color);
}

.social-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.social-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.social-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.facebook {
    background-color: #3b5998;
}

.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.twitter {
    background-color: #1da1f2;
}

.telegram {
    background-color: #0088cc;
}

/* Enhanced social media buttons */
.facebook-btn:hover:not(:disabled) {
    background-color: #e7ebf3;
    border-color: #3b5998;
}

.instagram-btn:hover:not(:disabled) {
    background-color: #fdf0eb;
    border-color: #e1306c;
}

.twitter-btn:hover:not(:disabled) {
    background-color: #e8f5fd;
    border-color: #1da1f2;
}

.telegram-btn:hover:not(:disabled) {
    background-color: #e7f3fa;
    border-color: #0088cc;
}

/*--------------------------------------------------------------
# Buttons
--------------------------------------------------------------*/
button {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--tiri-primary-color);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    margin-right: 10px;
    padding: 8px 15px;
    text-decoration: none;
    font-size: 18px;
    line-height: 20px;
    font-weight: 600;
    border-radius: 5px;
    background-color: var(--tiri-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.main-btn:hover:not(:disabled) {
    background-color: var(--tiri-primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.main-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    margin-right: 10px;
    padding: 5px 15px;
    text-decoration: none;
    font-size: 16px;
    line-height: 20px;
    font-weight: 300;
    border-radius: 5px;
    background-color: transparent;
    color: var(--tiri-text-color);
    border: 1px solid var(--tiri-border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover:not(:disabled) {
    background-color: var(--tiri-header-bg-color);
    transform: translateY(-2px);
}

/*--------------------------------------------------------------
# Airdrop Eligibility
--------------------------------------------------------------*/
.tiri-eligible {
    color: var(--tiri-success-color);
    font-weight: 600;
    font-size: 18px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.tiri-not-eligible {
    color: var(--tiri-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Confetti animation for airdrop */
@keyframes confettiRain {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 0% 100%;
    }
}

.tiri-eligibility-requirements {
    margin-top: 15px;
}

.tiri-eligibility-requirement {
    margin-bottom: 15px;
}

.tiri-requirement-label {
    margin-bottom: 5px;
    font-weight: 500;
}

.tiri-requirement-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tiri-requirement-values {
    display: flex;
    justify-content: center;
    gap: 3px;
    font-size: 16px;
    color: var(--tiri-text-muted);
}

.tiri-airdrop-claimed {
    margin-top: 15px;
}

.tiri-airdrop-amount {
    margin-bottom: 10px;
}

.tiri-airdrop-label {
    color: var(--tiri-text-muted);
    margin-right: 5px;
}

.tiri-airdrop-value {
    font-weight: 600;
    color: var(--tiri-text-color);
}

.tiri-airdrop-status {
    color: var(--tiri-success-color);
    font-weight: 500;
}

.tiri-progress-bar {
	margin: 10px 0 0 !important;
}
/*--------------------------------------------------------------
# Tier System
--------------------------------------------------------------*/
.tiri-tier-wrapper {
    margin-bottom: 15px;
}

.tiri-tier-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.tiri-tier-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.tiri-tier-info {
    display: flex;
    flex-direction: column;
}

.tiri-tier-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--tiri-text-color);
}

.tiri-tier-multiplier {
    color: var(--tiri-text-muted);
}

.tiri-tier-progress {
    margin-top: 10px;
}

.tiri-tier-progress-label {
	margin-bottom: 10px;
	font-weight: 500;
	font-size: 16px;
	color: var(--tiri-text-color);
}

.tiri-tier-requirements {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tiri-tier-requirement {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/*--------------------------------------------------------------
# Loading & Spinner
--------------------------------------------------------------*/
.tiri-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tiri-spinner {
    animation: spin 1s linear infinite;
}

/*--------------------------------------------------------------
# Toast Notifications
--------------------------------------------------------------*/

/* Confetti Button Styles */
.tiri-confetti-btn {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: #fff;
  background-color: #8e6eef;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tiri-confetti-btn:hover {
  background-color: #7451e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tiri-confetti-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tiri-confetti-btn:disabled {
  background-color: #b4a6e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tiri-confetti-btn svg {
  stroke-width: 2px;
}

/*--------------------------------------------------------------
# Animations
--------------------------------------------------------------*/
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(15px);
    }
}

/*--------------------------------------------------------------
# Reference Links
--------------------------------------------------------------*/
.tiri-reference-link {
    color: var(--tiri-primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--tiri-primary-color);
    transition: border-bottom 0.2s;
}

.tiri-reference-link:hover {
    border-bottom: 1px solid var(--tiri-primary-color);
}

/*--------------------------------------------------------------
# Responsive Adjustments
--------------------------------------------------------------*/
@media (max-width: 600px) {
    .tiri-dashboard-card {
        padding: 10px;
    }
    
    .tiri-card {
        padding: 15px 15px 25px 15px;
    }
    
    .tiri-points-display {
        justify-content: left;
    }
    
    .tiri-tier-header {
        flex-direction: column;
        align-items: baseline;
        text-align: left;
    }
    
    .tiri-tier-badge {
        margin-bottom: 10px;
    }
    
    .tiri-points-value {
        font-size: 28px;
    }
    
    .tiri-task-points {
        display: none;
    }
    
    .tiri-referral-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .tiri-referral-link-container {
        flex-direction: column;
    }
    
    #tiri-referral-link {
        width: 100%;
        margin-right: 0px;
        margin-top: 20px;
    }
    
    .tiri-social-buttons {
        grid-template-columns: 1fr 1fr;
    }

}