/* Thailand Field Day Contest Logger Styles */
:root {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FF9800;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.team-info {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Team Configuration */
.team-config {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.team-config.collapsed {
    max-height: 60px;
    overflow: hidden;
}

.config-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.config-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.config-row:last-child {
    margin-bottom: 0;
}

.logo-section {
    flex: 0 0 200px;
}

.logo-container {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.logo-container:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.logo-placeholder {
    text-align: center;
}

.logo-text {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.logo-upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.logo-upload-btn:hover {
    background: #1976D2;
}

.team-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.leader-section {
    flex: 1;
    min-width: 200px;
}

.leader-section label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.leader-input,
.grid-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: border-color 0.2s ease;
}

.leader-input:focus,
.grid-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Class Input */
.class-input-container {
    position: relative;
}

.class-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    transition: border-color 0.2s ease;
}

.class-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Compact Inputs Section */
.compact-inputs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inputs-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 80px;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-input {
    padding: 0.4rem 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.2s ease;
    background: white;
    min-width: 60px;
}

.compact-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.summary-row {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid #eee;
}

/* Class Help Tooltip */
.class-help-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 5px;
    animation: fadeInUp 0.3s ease;
}

.tooltip-content {
    padding: 1rem;
}

.tooltip-content h4 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.tooltip-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tooltip-content li {
    padding: 0.3rem 0;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid #f0f0f0;
}

.tooltip-content li:last-child {
    border-bottom: none;
}

.tooltip-content li strong {
    display: inline-block;
    width: 20px;
    color: var(--primary-color);
    font-weight: bold;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-section {
    flex: 1;
    min-width: 300px;
}

.operator-section {
    width: 100%;
    margin-bottom: 1rem;
}

.operator-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.operators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.operator-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.operator-item:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.operator-item input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.operator-callsign {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    background: transparent;
    transition: all 0.2s ease;
}

.operator-callsign:not([readonly]):focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.operator-callsign[readonly] {
    background: #e9ecef;
    color: var(--text-secondary);
    font-style: italic;
}

.config-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.log-qso-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.log-qso-button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.log-qso-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.toggle-config-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.toggle-config-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Grid Map Toggle Button */
.grid-map-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-map-toggle:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

/* Thailand Grid Map */
.grid-map-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.grid-map-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-map-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.close-map-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.close-map-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.thailand-grid-map {
    position: relative;
    background: url('mapgrid.PNG') no-repeat;
    background-size: 100% 100%;
    background-position: 0 0;
    border: 2px solid var(--border-color);
    overflow: hidden;
    min-height: 625px;
    max-width: 800px;
    margin: 0 auto;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}

.grid-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex: 1;
    margin: 0;
}

.grid-cell {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(33, 150, 243, 0.7);
    padding: 0.25rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    flex: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    color: #1565C0;
    border-radius: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(1px);
    min-height: 25px;
}

.grid-cell:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    text-shadow: none;
    backdrop-filter: none;
}

.grid-cell:active {
    transform: scale(0.95);
    background: #1976D2;
}

.grid-cell.worked {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    text-shadow: none;
    backdrop-filter: none;
}

.grid-cell.worked:hover {
    background: #45a049;
}

.grid-cell.selected {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
    animation: pulse 1.5s infinite;
    text-shadow: none;
    backdrop-filter: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.tab-button {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #f8f9fa;
}

.tab-button.active {
    background: #f8f9fa;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* QSO Form */
.qso-form {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 150px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Compact Form Styles */
.compact-form {
    padding: 1rem;
}

.compact-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.compact-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.compact-form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Specific widths for different field types */
.call-group {
    flex: 2;
    min-width: 120px;
}

.date-group {
    flex: 1;
    min-width: 90px;
}

.time-group {
    flex: 1;
    min-width: 80px;
}

.freq-group {
    flex: 1.2;
    min-width: 100px;
}

.mode-group {
    flex: 1;
    min-width: 80px;
}

.class-group {
    flex: 0.6;
    min-width: 50px;
}

.rst-group {
    flex: 0.8;
    min-width: 60px;
}

.grid-group {
    flex: 1;
    min-width: 80px;
}

/* Compact input overrides */
.compact-form .compact-input {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.call-input {
    text-align: left !important;
    font-size: 1rem !important;
    font-weight: 700;
}

.date-input, .time-input {
    font-size: 0.8rem;
    text-align: center;
}

.freq-input {
    text-align: center;
}

.mode-select, .class-select {
    font-size: 0.8rem;
    padding: 0.5rem 0.4rem;
}

.rst-input {
    text-align: center;
    font-weight: 700;
}

.grid-input {
    text-align: center;
    font-weight: 700;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.call-input {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.1rem !important;
}

.worked-indicator {
    background: var(--error-color);
    color: white;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    font-weight: bold;
    text-align: center;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.points-display {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid var(--secondary-color);
}

/* Satellite field visibility */
.satellite-field {
    transition: opacity 0.2s ease;
}

.satellite-field.hidden {
    opacity: 0.3;
}

.satellite-field.hidden select {
    background-color: #f5f5f5;
    color: #999;
}

.log-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.log-button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.log-button:active {
    transform: translateY(0);
}

/* QSO Log Table */
.qso-log {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.qso-log h3 {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.log-table-container {
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.log-table th,
.log-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.log-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.log-table tbody tr:hover {
    background: #f8f9fa;
}

.log-table .duplicate {
    background: #ffebee;
    color: var(--error-color);
}

.log-table .missing-class {
    background: #fff3e0;
    color: var(--warning-color);
}

/* Contest Summary */
.contest-summary {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.summary-item.total {
    background: var(--primary-color);
    color: white;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-item.total .summary-label {
    color: rgba(255,255,255,0.9);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Bonus Points */
.bonus-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.bonus-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.bonus-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.bonus-item:hover {
    border-color: var(--primary-color);
}

.bonus-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
}

.bonus-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
}

.upload-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.upload-button:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.upload-button:active {
    transform: translateY(0);
}

.upload-icon {
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

.uploaded-file {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.uploaded-file.has-file {
    background: #e8f5e8;
    color: var(--secondary-color);
    border: 1px solid #c8e6c9;
}

.file-preview {
    max-width: 100px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.remove-file {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: auto;
}

.remove-file:hover {
    background: #d32f2f;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Summary Tab */
.detailed-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mode-breakdown,
.duplicate-summary,
.export-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.mode-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.mode-table th,
.mode-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mode-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.status-item.error {
    background: #ffebee;
    color: var(--error-color);
}

.status-label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.export-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.export-button:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

/* Grids */
.grids-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.grids-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.grid-square {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.grid-square.worked {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.grid-square:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.grid-square .grid-name {
    font-weight: bold;
}

.grid-square .qso-count {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Status Bar */
.status-bar {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-online {
    color: var(--secondary-color);
    font-weight: 500;
}

.status-offline {
    color: var(--error-color);
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .inputs-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .input-group {
        min-width: auto;
        width: 100%;
    }
    
    .compact-form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .compact-form-group {
        min-width: auto;
        width: 100%;
    }
    
    .summary-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

@media (max-width: 768px) {
    .header-content {
        padding: 0 0.5rem;
    }
    
    .title {
        font-size: 1.4rem;
    }
    
    .team-info {
        font-size: 0.95rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        min-width: calc(50% - 1px);
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .qso-form {
        padding: 1rem;
    }
    
    .log-table {
        font-size: 0.8rem;
    }
    
    .log-table th,
    .log-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-button {
        width: 100%;
    }
    
    .grids-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .bonus-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .upload-button {
        align-self: flex-start;
    }
    
    .config-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-section {
        flex: none;
    }
    
    .logo-container {
        height: 100px;
    }
    
    .operators-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .operator-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .operator-callsign {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .config-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .log-qso-button {
        width: 100%;
    }
    
    .grid-map-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .grid-cell {
        font-size: 0.5rem;
        padding: 0.1rem;
        min-height: 20px;
    }
    
    .grid-map-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .thailand-grid-map {
        min-height: 350px;
        background-size: 100% 100%;
        max-width: 100%;
    }
    
    .class-help-tooltip {
        position: fixed;
        top: 50%;
        left: 5%;
        right: 5%;
        transform: translateY(-50%);
        z-index: 1001;
    }
    
    .tooltip-content {
        padding: 0.75rem;
    }
    
    .tooltip-content h4 {
        font-size: 0.85rem;
    }
    
    .tooltip-content li {
        font-size: 0.8rem;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }
    
    .team-info {
        font-size: 0.9rem;
    }
    
    .tab-button {
        font-size: 0.7rem;
        padding: 0.625rem 0.25rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .grids-container {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .operators-grid {
        gap: 0.25rem;
    }
    
    .operator-item {
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .operator-callsign {
        padding: 0.3rem;
        font-size: 0.75rem;
    }
    
    .inputs-row {
        gap: 0.25rem;
    }
    
    .compact-form-row {
        gap: 0.25rem;
    }
    
    .summary-row {
        gap: 0.25rem;
    }
    
    .compact-input {
        padding: 0.35rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .tabs,
    .status-bar {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .main-content {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}