/* Best Trees Australia - Custom Styles */

/* CSS Variables */
:root {
    --forest: #228B22;
    --leaf: #32CD32;
    --bark: #8B4513;
    --sage: #9DC183;
    --moss: #4A5D23;
    --cream: #F5F5DC;
}

/* Global Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero Gradient */
.hero-gradient {
    background: linear-gradient(135deg, var(--forest) 0%, var(--moss) 50%, var(--bark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23ffffff08' d='M50 5 L65 35 L55 35 L70 60 L58 60 L75 90 L25 90 L42 60 L30 60 L45 35 L35 35 Z'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    opacity: 0.1;
}

/* Tree Cards */
.tree-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
}

.tree-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tree-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--sage) 0%, var(--forest) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.tree-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--forest);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tree-card-content {
    padding: 20px;
}

.tree-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest);
    margin-bottom: 4px;
}

.tree-card-scientific {
    font-style: italic;
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.tree-card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.tree-card-spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #555;
}

.tree-card-spec svg {
    width: 16px;
    height: 16px;
    color: var(--forest);
}

.tree-card-btn {
    display: block;
    width: 100%;
    background: var(--forest);
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
}

.tree-card-btn:hover {
    background: var(--moss);
}

.compare-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid var(--forest);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.compare-checkbox.active {
    background: var(--forest);
}

.compare-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.compare-checkbox.active svg {
    opacity: 1;
}

/* Filter Buttons */
.filter-btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active {
    background: var(--forest) !important;
    color: white !important;
}

/* Quiz Styles */
.quiz-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--forest), var(--leaf));
    transition: width 0.3s ease;
}

.quiz-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--forest);
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-option:hover {
    border-color: var(--sage);
    background: var(--sage);
    background-opacity: 0.1;
}

.quiz-option.selected {
    border-color: var(--forest);
    background: rgba(34, 139, 34, 0.1);
}

.quiz-option-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.quiz-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.quiz-btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-btn-secondary {
    background: #e5e7eb;
    color: #374151;
    border: none;
}

.quiz-btn-secondary:hover {
    background: #d1d5db;
}

.quiz-btn-primary {
    background: var(--forest);
    color: white;
    border: none;
}

.quiz-btn-primary:hover {
    background: var(--moss);
}

.quiz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quiz Result */
.quiz-result-card {
    text-align: center;
    padding: 20px;
}

.quiz-result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.quiz-result-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--forest);
    margin-bottom: 8px;
}

.quiz-result-match {
    color: var(--leaf);
    font-weight: 600;
    margin-bottom: 16px;
}

.quiz-result-description {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Comparison Table */
.comparison-table-wrapper {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: var(--forest);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: rgba(157, 193, 131, 0.1);
}

.comparison-header-cell {
    text-align: center;
}

.comparison-tree-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.comparison-tree-name {
    font-weight: 600;
    color: var(--forest);
}

/* Data Table */
#trees-table {
    border-collapse: collapse;
    width: 100%;
}

#trees-table th {
    position: relative;
}

#trees-table th::after {
    content: '↕';
    margin-left: 8px;
    opacity: 0.5;
}

#trees-table tbody tr {
    transition: background 0.2s ease;
}

#trees-table tbody tr:hover {
    background: rgba(157, 193, 131, 0.2);
}

#trees-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

#trees-table tbody tr:nth-child(even):hover {
    background: rgba(157, 193, 131, 0.2);
}

/* Rating Stars */
.rating {
    color: #fbbf24;
    letter-spacing: 2px;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--forest);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--moss);
    transform: translateY(-4px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tree-card {
    animation: fadeIn 0.5s ease forwards;
}

.tree-card:nth-child(1) { animation-delay: 0.1s; }
.tree-card:nth-child(2) { animation-delay: 0.2s; }
.tree-card:nth-child(3) { animation-delay: 0.3s; }
.tree-card:nth-child(4) { animation-delay: 0.4s; }
.tree-card:nth-child(5) { animation-delay: 0.5s; }
.tree-card:nth-child(6) { animation-delay: 0.6s; }
.tree-card:nth-child(7) { animation-delay: 0.7s; }
.tree-card:nth-child(8) { animation-delay: 0.8s; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tree-card-specs {
        grid-template-columns: 1fr;
    }

    .quiz-question {
        font-size: 1.25rem;
    }

    .quiz-option {
        padding: 12px 16px;
    }

    .quiz-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .quiz-btn {
        width: 100%;
    }

    .comparison-table {
        font-size: 0.875rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}

/* Print Styles */
@media print {
    .hero-gradient,
    header,
    footer,
    .scroll-top,
    #quiz,
    .filter-btn {
        display: none;
    }

    .tree-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
:focus-visible {
    outline: 3px solid var(--leaf);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
