}

/* Main Wrapper */
.token-counter-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.header-section h1 {
    margin: 0;
    font-size: 2.5rem;
    color: var(--md-primary-fg-color);
}

.subtitle {
    color: var(--md-default-fg-color--light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Main Container - 2 Column Layout */
.main-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Left Panel */
.left-panel {
    background: var(--md-default-bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--md-default-fg-color--lightest);
}

.input-section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: var(--md-default-fg-color);
    margin-bottom: 0.75rem;
}

#textInput {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--md-primary-fg-color--light);
    border-radius: 8px;
    font-family: var(--md-code-font-family);
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s;
    background: var(--md-default-bg-color);
    color: var(--md-default-fg-color);
}

#textInput:focus {
    outline: none;
    border-color: var(--md-primary-fg-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Stats Grid - Horizontal 2x2 Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-card.highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: var(--md-primary-fg-color);
}

.stat-card.highlight .stat-value {
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.model-section {
    background: var(--md-default-bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--md-default-fg-color--lightest);
}

.model-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--md-primary-fg-color--light);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--md-default-bg-color);
    color: var(--md-default-fg-color);
    cursor: pointer;
    transition: border-color 0.3s;
}

.model-select:focus {
    outline: none;
    border-color: var(--md-primary-fg-color);
}

/* Cost Card */
.cost-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
}

.cost-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cost-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-row.total {
    border-bottom: none;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.cost-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.cost-amount {
    font-size: 1rem;
    font-weight: bold;
}

.cost-total {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Ratio Control */
.ratio-control {
    background: var(--md-default-bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--md-default-fg-color--lightest);
}

.ratio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ratio-value {
    font-weight: bold;
    color: var(--md-primary-fg-color);
}

.ratio-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--md-default-fg-color--lightest);
    outline: none;
    -webkit-appearance: none;
}

.ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--md-primary-fg-color);
    cursor: pointer;
}

.ratio-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--md-primary-fg-color);
    cursor: pointer;
    border: none;
}

.ratio-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--md-default-fg-color--light);
}

/* Info Tip */
.info-tip {
    background: #fff9e6;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    font-size: 0.9rem;
    color: #856404;
}

/* Dark Mode Support */
[data-md-color-scheme="slate"] .stat-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

[data-md-color-scheme="slate"] .stat-card.highlight {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

[data-md-color-scheme="slate"] .info-tip {
    background: #3d3418;
    color: #f1c40f;
}

/* Knowledge Section */
.knowledge-section {
    margin: 3rem 0;
}

.knowledge-section h2 {
    text-align: center;
    color: var(--md-primary-fg-color);
    margin-bottom: 2rem;
}

.use-cases {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.use-case {
    text-align: center;
    padding: 1.5rem;
    background: var(--md-default-bg-color);
    border-radius: 10px;
    border: 1px solid var(--md-default-fg-color--lightest);
    transition: transform 0.2s, box-shadow 0.2s;
}

.use-case:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.use-case-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--md-primary-fg-color);
}

.use-case-desc {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.knowledge-card {
    background: var(--md-default-bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--md-default-fg-color--lightest);
}

.knowledge-card h3 {
    color: var(--md-primary-fg-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

.knowledge-card ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.knowledge-card li {
    margin: 0.5rem 0;
}

/* Version Footer */
.version-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--md-default-bg-color);
    border-radius: 8px;
    border: 1px solid var(--md-default-fg-color--lightest);
    text-align: center;
}

.version-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.version-label {
    color: var(--md-default-fg-color--light);
}

.version-number {
    font-weight: bold;
    color: var(--md-primary-fg-color);
    font-family: var(--md-code-font-family);
}

.version-date {
    font-family: var(--md-code-font-family);
}

.version-separator {
    color: var(--md-default-fg-color--lighter);
}

.version-status {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

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

[data-md-color-scheme="slate"] .status-stable {
    background: #1e4620;
    color: #4CAF50;
}

.version-copyright {
    color: var(--md-default-fg-color--light);
    font-size: 0.85rem;
}

/* 📱 Mobile Responsive */
@media screen and (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .use-cases {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .token-counter-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .header-section h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    /* Stats Grid - 2x2 on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    #textInput {
        min-height: 150px;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .left-panel, .right-panel > * {
        padding: 1rem;
    }
    
    .model-select {
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .use-cases {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .header-section h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-icon {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .cost-total {
        font-size: 1.25rem;
    }
}

/* Landscape Mode */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #textInput {
        min-height: 100px;
    }
}
