/**
 * Ham Radio Logbook Stylesheet
 * N5UI.com/logbook
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;  /* Default width - overridden by inline style from layout_config.json */
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 600;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.stats span {
    font-size: 0.95em;
    color: #ecf0f1;
}

.stats strong {
    color: #3498db;
    font-size: 1.2em;
}

/* Search container */
.search-container {
    padding: 25px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.search-container form {
    display: flex;
    flex-wrap: nowrap;  /* Prevent wrapping to new line */
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;  /* Keep form centered when narrower than max-width */
}

.search-input {
    flex: 1;  /* Take available space, shrinks as page narrows */
    min-width: 150px;  /* Minimum width on very small screens */
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-button {
    padding: 12px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.search-button:hover {
    background: #2980b9;
}

.clear-button {
    padding: 12px 20px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
}

.clear-button:hover {
    background: #7f8c8d;
}

.search-results {
    text-align: center;
    margin-top: 15px;
    color: #555;
}

/* Table container */
.table-container {
    overflow-x: auto;
}

/* Logbook table */
.logbook-table {
    width: 100%;
    border-collapse: collapse;
}

.logbook-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.logbook-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logbook-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.logbook-table tbody tr:hover {
    background-color: #f8f9fa;
}

.logbook-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.logbook-table tbody tr:nth-child(even):hover {
    background-color: #f1f3f5;
}

.logbook-table td {
    padding: 12px;
    font-size: 0.95em;
    color: #495057;
    white-space: nowrap;
}

/* Callsign styling */
.callsign {
    font-weight: 600;
}

.callsign a {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.2s;
}

.callsign a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Optional columns styling */
.logbook-table td:nth-child(11), /* DXCC */
.logbook-table td:nth-child(12), /* Grid */
.logbook-table td:nth-child(13), /* Frequency */
.logbook-table td:nth-child(14), /* Name */
.logbook-table td:nth-child(15), /* QTH */
.logbook-table td:nth-child(16), /* Power */
.logbook-table td:nth-child(17), /* Comment */
.logbook-table td:nth-child(18), /* QSL Sent */
.logbook-table td:nth-child(19)  /* QSL Rcvd */
{
    font-size: 0.9em;
}

/* Flag cell */
.flag-cell {
    text-align: left;  /* Changed from center to left for alignment */
    padding: 8px 4px;  /* Reduced horizontal padding from 12px to 4px */
}

.flag-icon {
    /* Flag Size Options - Uncomment the size you prefer */
    
    /* Original (Tiny) - 16px × 24px */
    /* height: 16px;
    width: 24px; */
     
    /* Conservative (Very Small) - 24px × 36px - ACTIVE */
    height: 20px;
    width: 30px;
	
    /* Conservative (Small) - 24px × 36px */
    /* height: 24px;
       width: 36px;  */
    
    /* Moderate (Medium) - 32px × 48px */
    /* height: 32px;
       width: 48px; */
    
    /* Bold (Large) - 40px × 60px */
    /* height: 40px;
       width: 60px; */
    
    /* Extra Bold (Extra Large) - 48px × 72px */
    /* height: 48px;
       width: 72px; */
    
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    vertical-align: middle;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.page-link {
    padding: 8px 12px;
    background: white;
    color: #495057;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9em;
    min-width: 36px;
    text-align: center;
}

.page-link:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.page-link.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}

.page-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
}

/* Footer */
footer {
    padding: 20px 30px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .stats {
        gap: 15px;
    }

    /* Removed flex-direction: column to keep search inline */

    .logbook-table {
        font-size: 0.85em;
    }

    .logbook-table th,
    .logbook-table td {
        padding: 8px 6px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 0.85em;
        min-width: 32px;
    }
}

@media (max-width: 480px) {
    .stats {
        flex-direction: column;
        gap: 8px;
    }

    .logbook-table th:nth-child(5),
    .logbook-table td:nth-child(5),
    .logbook-table th:nth-child(6),
    .logbook-table td:nth-child(6) {
        display: none; /* Hide RST columns on very small screens */
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .search-container,
    .pagination,
    footer {
        display: none;
    }

    .logbook-table tbody tr:hover {
        background-color: transparent;
    }
}
