/* Page Layout */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

.left-content {
    flex: 1;
    max-width: 600px;
}

.title-with-logo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.farming-logo {
    font-size: 48px;
    color: #06b6d4;
    flex-shrink: 0;
    margin-top: 0.25rem;
    line-height: 1;
}

.left-content h1 {
    color: #06b6d4;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.left-content .subtitle {
    color: #9ca3af;
    font-size: 1.1rem;
    margin: 1rem 0 1.5rem 0;
    line-height: 1.4;
}

.create-farm-btn-main {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.create-farm-btn-main:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Farm Summary Card */
.farm-summary-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-shrink: 0;
    gap: 20px;
}

.farm-summary-card {
    background: linear-gradient(145deg, #1a2332, #0f1419);
    border-radius: 12px;
    padding: 36px 20px 20px 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    width: 280px;
    border: 1px solid #2a3441;
    position: relative;
    margin-top: 16px;
}

/* Filters Section */
.filters-container {
    margin-bottom: 1.5rem;
}

.filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    margin-top: 12px;
    position: relative;
}

.summary-header h3 {
    color: #e5e7eb;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.summary-header::before {
    content: "★ TOP FARM";
    position: absolute;
    top: -32px;
    left: -8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.summary-header::after {
    content: "";
    position: absolute;
    top: -32px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Use the provided XWT.png logo. Path assumes XWT.png is at project root (next to index.html). */
    background-image: url('/XWT.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Fallback color if image is missing */
    background-color: #059669;
    /* Subtle ring and elevation so it stands out on dark background */
    box-shadow: 0 0 0 2px #0f1419, 0 2px 6px rgba(0,0,0,0.5);
    z-index: 10;
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.summary-stat span {
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-stat strong {
    color: #10b981;
    font-size: 1.2rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .title-with-logo {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .farming-logo {
        font-size: 40px;
        color: #06b6d4;
        margin-top: 0;
    }
    
    .left-content h1 {
        font-size: 2rem;
    }
    
    .left-content .subtitle {
        font-size: 1rem;
        margin: 0.75rem 0 1rem 0;
    }
    
    /* Make card flex to share row with the chest on mobile */
    .farm-summary-card {
        width: auto;
        flex: 1;
        min-width: 0; /* allow flex item to shrink within row */
    }
    
    /* Place chest and TOP FARM card side-by-side on mobile */
    .farm-summary-container {
        justify-content: center;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .treasure-sprite-container {
        margin-top: 0;
        order: 0; /* keep alongside the card */
    }
}

/* Farm list styles */
.farm-list {
    margin-bottom: 2rem;
}

.farm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.farm-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.farm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.farm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    min-height: 60px;
}

.farm-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-height: 40px;
}

.farm-title img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.farm-title h3 {
    font-size: 1.25rem;
    color: #fbbf24;
    line-height: 1.3;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.farm-badge {
    background-color: #374151;
    color: #9ca3af;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.farm-badge.active {
    background-color: #10b981;
    color: #fff;
}

.farm-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    background-color: rgba(31, 41, 55, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
}

.detail-item p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.detail-item h4 {
    color: #4ade80;
    font-size: 1.1rem;
}

.farm-actions {
    display: flex;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
    margin-top: auto;
}

.farm-actions .btn {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.empty-state p {
    color: #9ca3af;
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .farm-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .detail-item {
        padding: 0.75rem;
    }
}/* Enhanced farm card styles */
.farm-card.verified {
    border-left: 3px solid #06b6d4;
}

.farm-card.suspicious {
    border-left: 3px solid #ef4444;
    opacity: 0.8;
}

.farm-card.ended {
    opacity: 0.7;
}

.farm-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.status-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-weight: 600;
}

.mini-badge.verified {
    background-color: #06b6d4;
    color: #fff;
}

.mini-badge.suspicious {
    background-color: #ef4444;
    color: #fff;
}

.total-rewards-amount {
    color: #4ade80 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.reward-breakdown {
    display: block !important;
    font-size: 0.7rem !important;
    color: #22c55e !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.reward-breakdown.xwt-earned {
    color: #22c55e !important;
}

.reward-breakdown.referral-earned {
    color: #22c55e !important;
}

/* Removed legacy styles to prevent conflicts */

/* Disabled button styles */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background-color: inherit;
}

/* Debug styles for buttons */
.details-button:hover {
    background-color: #4b5563 !important;
    transform: scale(1.05);
}

.claim-rewards-button:hover {
    background-color: #22c55e !important;
    transform: scale(1.05);
}

.claim-rewards-button:disabled {
    background-color: #6b7280 !important;
    cursor: not-allowed;
    transform: none;
}

.claim-rewards-button:disabled:hover {
    background-color: #6b7280 !important;
    transform: none;
}/* 
Error state styles */
.error-state {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
    background: linear-gradient(145deg, #7f1d1d, #991b1b);
    border-radius: 0.75rem;
    border: 2px solid #ef4444;
}

.error-state h3 {
    color: #fecaca;
    margin-bottom: 1rem;
}

.error-state p {
    color: #fca5a5;
    margin-bottom: 2rem;
}

.error-state .btn {
    background-color: #ef4444;
    color: #fff;
}

.error-state .btn:hover {
    background-color: #dc2626;
}/* 
Loading state styles */
.loading-state {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 0.75rem;
    border: 2px solid #374151;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #374151;
    border-top: 4px solid #4ade80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Metallic shine animation for TOP FARM card */
@keyframes metallic-shine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.farm-summary-card {
    background: linear-gradient(145deg, #1a2332, #0f1419);
    border-radius: 12px;
    padding: 36px 20px 20px 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    width: 280px;
    border: 1px solid #2a3441;
    position: relative;
    margin-top: 16px;
    /* Add overflow hidden to contain the shine effect */
    overflow: hidden;
}

.farm-summary-card.shine {
    /* Add the shine overlay */
    position: relative;
}

.farm-summary-card.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: metallic-shine 3s infinite;
    pointer-events: none;
    z-index: 10;
}

.farm-summary-card .summary-content {
    position: relative;
    z-index: 1;
}

.loading-state h3 {
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.loading-state p {
    color: #9ca3af;
}
/* Crea
te Farm Button */
.create-farm-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-farm-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Hide the original farm badge in summary card */
.farm-summary-card .farm-badge {
    display: none;
}/* S
earch functionality styles */
.search-toggle-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.search-toggle-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.search-container {
    width: 100%;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.search-container.hidden {
    display: none;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 2px solid #374151;
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    color: #9ca3af;
    margin-right: 0.75rem;
    font-size: 1rem;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1rem;
    outline: none;
    padding: 0;
}

#search-input::placeholder {
    color: #6b7280;
}

.search-close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.search-close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Filter buttons hidden state */
.filters.search-active #filter-buttons {
    display: none;
}

/* Responsive search styles */
@media (max-width: 768px) {
    .search-input-wrapper {
        padding: 0.5rem;
    }
    
    .search-icon {
        margin-right: 0.5rem;
    }
    
    #search-input {
        font-size: 0.9rem;
    }
}
/* Pag
ination Styles */
.pagination-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pagination-info {
    color: #9ca3af;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-btn {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #e5e7eb;
    border: 1px solid #4b5563;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-btn:disabled:hover {
    background: linear-gradient(135deg, #374151, #1f2937);
    transform: none;
    box-shadow: none;
}

.page-indicator {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 0.5rem;
    border: 1px solid #374151;
    min-width: 120px;
    text-align: center;
}

.prev-btn i {
    margin-right: 0.25rem;
}

.next-btn i {
    margin-left: 0.25rem;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-btn {
        flex: 1;
        max-width: 120px;
    }
    
    .page-indicator {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .pagination-btn span {
        display: none;
    }
    
    .page-indicator {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-width: 80px;
    }
}

/* Update responsive grid for farm cards */
@media (max-width: 1200px) {
    .farm-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .farm-grid {
        grid-template-columns: 1fr;
    }
}