:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-glass: rgba(45, 45, 45, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    /* Category colors */
    --color-black: #8b4513;
    --color-green: #4a7c59;
    --color-white: #d4c5b9;
    --color-blue: #5b7fa6;
    --color-oolong: #c9a961;
    --color-yellow: #d4af37;
    --color-pu-erh: #6b4423;
    
    /* Accent colors */
    --accent-warm: #d4a574;
    --accent-gold: #f4d03f;
    
    /* Glass effect */
    --glass-blur: blur(10px);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(244, 208, 63, 0.08) 0%, transparent 50%);
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.subtitle-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Glass effect container */
.table-wrapper {
    margin: 2rem 0;
    width: 100%;
}

.table-container {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Table styles */
.tea-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    table-layout: fixed;
}

/* Column width constraints - fixed widths for all columns */
.tea-table th:nth-child(1),
.tea-table td:nth-child(1) {
    width: 200px !important;
    min-width: 200px !important;
}

.tea-table th:nth-child(2),
.tea-table td:nth-child(2) {
    width: 120px !important;
    min-width: 120px !important;
}

.tea-table th:nth-child(3) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center;
}

.tea-table td:nth-child(3) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center;
}

.tea-table th:nth-child(4),
.tea-table td:nth-child(4) {
    width: 130px !important;
    min-width: 130px !important;
}

.tea-table th:nth-child(5),
.tea-table td:nth-child(5) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center;
}

.tea-table th:nth-child(5) {
    padding-left: 1.5rem;
    padding-right: 2.5rem; /* Extra space for sort arrow */
    white-space: nowrap; /* Prevent text wrapping */
}

.tea-table th:nth-child(6),
.tea-table td:nth-child(6) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center;
}

.tea-table th:nth-child(6) {
    padding-left: 1.5rem;
    padding-right: 2.5rem; /* Extra space for sort arrow */
    white-space: nowrap; /* Prevent text wrapping */
}

.tea-table th:nth-child(7),
.tea-table td:nth-child(7) {
    width: 140px !important;
    min-width: 140px !important;
}

.tea-table th:nth-child(7) {
    padding-left: 1.5rem;
    padding-right: 2.5rem; /* Extra space for sort arrow */
    white-space: nowrap; /* Prevent text wrapping */
}

.tea-table th:nth-child(8),
.tea-table td:nth-child(8) {
    width: 200px !important;
    min-width: 200px !important;
}

.tea-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tea-table th {
    padding: 1.25rem 2rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(45, 45, 45, 0.6);
    backdrop-filter: blur(10px);
    position: relative;
    user-select: none;
    vertical-align: middle;
    height: 3.5rem;
    line-height: 1.5rem;
}

.tea-table th.sortable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 1.5rem !important; /* Space for sort arrow */
    background-position: right center;
    background-repeat: no-repeat;
}

.tea-table th.sortable:hover {
    color: var(--accent-warm);
    background: rgba(212, 165, 116, 0.1);
}

.tea-table th.sortable > span {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.5rem;
}

/* Sort indicator as ::after pseudo-element */
.tea-table th.sortable::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--text-secondary);
    border-top: none;
    opacity: 0.3;
    transition: all 0.3s ease;
}

/* Ensure proper alignment for Time, Temperature, Quantity headers */
.tea-table th:nth-child(5).sortable,
.tea-table th:nth-child(6).sortable,
.tea-table th:nth-child(7).sortable {
    vertical-align: middle !important;
    text-align: center;
}

.tea-table th.sortable:hover::after {
    opacity: 0.6;
}

.tea-table th.sort-asc::after {
    border-bottom: 6px solid var(--accent-warm);
    border-top: none;
    opacity: 1;
}

.tea-table th.sort-desc::after {
    border-top: 6px solid var(--accent-warm);
    border-bottom: none;
    opacity: 1;
}

.tea-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.tea-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    box-shadow: -4px 0 0 rgba(212, 165, 116, 0.3);
}

.tea-table tbody tr:last-child {
    border-bottom: none;
}

.tea-table td {
    padding: 1.5rem 2rem;
    color: var(--text-primary);
    vertical-align: middle;
    line-height: 1.5rem;
    height: auto;
    min-height: 3.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.category-badge.black {
    background: linear-gradient(135deg, var(--color-black), #6b3410);
    color: #f5deb3;
    border: 1px solid rgba(245, 222, 179, 0.2);
}

.category-badge.green {
    background: linear-gradient(135deg, var(--color-green), #3a5d47);
    color: #d4edda;
    border: 1px solid rgba(212, 237, 218, 0.2);
}

.category-badge.white {
    background: linear-gradient(135deg, var(--color-white), #b8a896);
    color: #2d2d2d;
    border: 1px solid rgba(45, 45, 45, 0.2);
}

.category-badge.blue {
    background: linear-gradient(135deg, var(--color-blue), #4a6b8a);
    color: #d6e8f5;
    border: 1px solid rgba(214, 232, 245, 0.2);
}

.category-badge.oolong {
    background: linear-gradient(135deg, var(--color-oolong), #a88d4a);
    color: #2d2d2d;
    border: 1px solid rgba(45, 45, 45, 0.2);
}

.category-badge.yellow {
    background: linear-gradient(135deg, var(--color-yellow), #b8941f);
    color: #2d2d2d;
    border: 1px solid rgba(45, 45, 45, 0.2);
}

.category-badge.pu-erh {
    background: linear-gradient(135deg, var(--color-pu-erh), #4d2f18);
    color: #e8d5c4;
    border: 1px solid rgba(232, 213, 196, 0.2);
}

.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Rating and notes cells */
.rating-cell {
    font-size: 1.1rem;
    text-align: center;
    vertical-align: middle;
}

.notes-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 400px;
    vertical-align: middle;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer #teaCount {
    color: var(--accent-warm);
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        padding: 0 0.75rem !important;
    }
    
    .header {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }
    
    .title {
        font-size: 1.75rem !important;
        margin-bottom: 0.25rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .subtitle {
        font-size: 0.9rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .subtitle-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .table-wrapper {
        margin: 1rem 0;
    }
    
    .table-container {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    .tea-table {
        font-size: 0.8rem;
    }
    
    .tea-table th,
    .tea-table td {
        padding: 0.5rem 0.5rem;
    }
    
    .tea-table th {
        font-size: 0.7rem;
        padding: 0.75rem 0.5rem;
    }
    
    .footer {
        padding: 1rem 0;
        margin-top: 1.5rem;
    }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-warm);
}

