/* Holiday Seminars Database - Main Stylesheet */

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

body { 
    font-family: Arial, sans-serif; 
    background: #f5f5f5; 
    min-height: 100vh; 
    padding: 20px; 
}

/* Layout containers */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.header { 
    background: white; 
    border: 1px solid #ddd; 
    padding: 20px; 
    margin-bottom: 20px; 
}

/* Typography */
h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
    text-align: center;
    font-weight: normal;
}

/* Logo styling */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-title {
    font-size: 2.5em;
    font-weight: 600;
    color: #2c5282;
    margin: 0 0 5px 0;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 0.95em;
    color: #718096;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.admin-link-container {
    text-align: center;
    margin-top: 10px;
}

.admin-link {
    display: inline-block;
    font-size: 0.85em;
    color: #718096;
    text-decoration: none;
    transition: color 0.2s ease;
}

.admin-link:hover {
    color: #2c5282;
    text-decoration: underline;
}

/* Search instructions */
.search-instructions {
    text-align: center;
    color: #4a5568;
    font-size: 0.95em;
    margin: 0 0 15px 0;
    font-weight: 400;
}

/* Search components */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 12px 50px 12px 50px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

#searchInput:focus {
    border-color: #666;
}

.clear-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.clear-button:hover {
    color: #333;
}

.clear-button:focus {
    outline: 2px solid #666;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Statistics */
.stats { 
    text-align: center; 
    margin-top: 15px; 
    color: #666; 
    font-size: 11.2px; 
}

.stats span { 
    display: inline-block; 
    padding: 5px 12px; 
    background: #f9f9f9; 
    border: 1px solid #ddd; 
    margin: 0 5px; 
}

/* Results container */
.results-container {
    margin-top: 30px;
    width: 100%;
    overflow-x: auto;
    /* Remove max-height to allow full table display */
    /* Tables will naturally expand and page will scroll */
}

/* Result cards */
.result-card { 
    background: white; 
    border: 1px solid #ddd; 
    padding: 20px; 
    margin-bottom: 15px; 
}

.result-header { 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

.result-name { 
    font-size: 18px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 5px; 
}

.result-meta { 
    color: #868686; 
    font-size: 12px; 
}

/* Field display grid */
.result-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
}

.field-section { 
    background: #f9f9f9; 
    border: 1px solid #eee; 
    padding: 15px; 
}

.section-title { 
    font-size: 12px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 10px; 
    text-transform: uppercase; 
}

.field-row { 
    display: flex; 
    justify-content: space-between; 
    padding: 6px 0; 
    border-bottom: 1px solid #e0e0e0; 
}

.field-row:last-child { 
    border-bottom: none; 
}

.field-label { 
    font-size: 12px; 
    color: #666; 
    font-weight: normal; 
}

.field-value { 
    font-size: 12px; 
    color: #333; 
    text-align: right; 
    max-width: 60%; 
    word-break: break-word; 
}

.empty-value { 
    color: #ccc; 
    font-style: italic; 
}

/* Search highlighting */
.highlight {
    background-color: #ffff99;
    font-weight: bold;
}

/* Email links */
.email-link {
    color: #2563eb;
    text-decoration: none;
}

.email-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Table styling */
.results-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
    font-size: 11px;
    table-layout: auto;
}

.results-table th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 4px;
    text-align: left;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
}

.results-table td {
    border: 1px solid #ddd;
    padding: 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table tr:hover {
    background-color: #f0f0f0;
}

/* No results state */
.no-results {
    background: white;
    border: 1px solid #ddd;
    padding: 40px 30px;
    text-align: center;
    color: #999;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover {
    background-color: #e0f2fe !important;
}

/* Name cells styling */
.name-cell {
    color: #2563eb;
    font-weight: 600;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #333;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c5282;
    margin: 0 0 20px 0;
    padding-right: 40px;
}

.modal-body {
    color: #333;
}

.modal-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.modal-section .field-row {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.modal-section .field-row:last-child {
    border-bottom: none;
}

/* Show More button */
.show-more-button {
    display: block;
    margin: 20px auto 40px auto;
    padding: 14px 32px;
    background: #2c5282;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.3);
}

.show-more-button:hover {
    background: #1a365d;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.4);
    transform: translateY(-1px);
}

.show-more-button:active {
    transform: translateY(0) scale(0.98);
}

.show-more-button:focus {
    outline: 2px solid #2c5282;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ============================================ */

/* Tablet (iPad) styles - 768px to 1024px */
@media screen and (max-width: 1024px) {
    body {
        padding: 15px;
    }

    .logo-image {
        width: 70px;
        height: 70px;
    }

    .logo-title {
        font-size: 2em;
    }

    .logo-subtitle {
        font-size: 0.9em;
    }

    .search-instructions {
        font-size: 0.9em;
    }

    .results-table {
        font-size: 10px;
    }

    .results-table th,
    .results-table td {
        padding: 6px 3px;
        font-size: 10px;
    }

    .results-container {
        /* Allow natural scrolling on iPad */
    }
}

/* Mobile (iPhone) styles - up to 767px */
@media screen and (max-width: 767px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 15px 10px;
    }

    /* Modal adjustments for mobile */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .modal-content {
        padding: 20px 15px;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 20px;
        padding-right: 35px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .modal-section h3 {
        font-size: 13px;
    }

    .logo-container {
        margin-bottom: 20px;
    }

    .logo-image {
        width: 60px;
        height: 60px;
    }

    .logo-title {
        font-size: 1.5em;
        letter-spacing: -0.3px;
    }

    .logo-subtitle {
        font-size: 0.8em;
    }

    .admin-link {
        font-size: 0.75em;
    }

    .search-instructions {
        font-size: 0.85em;
        margin: 0 0 10px 0;
        padding: 0 5px;
    }

    .search-container {
        max-width: 100%;
    }

    .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    #searchInput {
        padding: 10px 40px 10px 40px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .clear-button {
        right: 10px;
    }

    .stats {
        font-size: 10px;
        margin-top: 10px;
    }

    .stats span {
        padding: 4px 8px;
        margin: 2px;
        font-size: 10px;
    }

    .results-container {
        margin-top: 20px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        /* Allow natural page scrolling on mobile */
    }

    /* Mobile: Make table scrollable horizontally with sticky name columns */
    .results-table {
        font-size: 9px;
    }

    .results-table th,
    .results-table td {
        padding: 6px 2px;
        font-size: 9px;
        min-width: 60px;
    }

    /* Make name columns sticky and always visible on mobile */
    .results-table th:nth-child(2), /* First Name */
    .results-table td:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 20;
        background-color: #f5f5f5;
        min-width: 90px;
        max-width: 90px;
        font-weight: 600;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.15);
    }

    .results-table td:nth-child(2) {
        background-color: white;
    }

    .results-table tr:nth-child(even) td:nth-child(2) {
        background-color: #f9f9f9;
    }

    .results-table tr:hover td:nth-child(2) {
        background-color: #e0f2fe;
    }

    .results-table th:nth-child(3), /* Last Name */
    .results-table td:nth-child(3) {
        position: sticky;
        left: 90px;
        z-index: 20;
        background-color: #f5f5f5;
        min-width: 90px;
        max-width: 90px;
        font-weight: 600;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.15);
    }

    .results-table td:nth-child(3) {
        background-color: white;
    }

    .results-table tr:nth-child(even) td:nth-child(3) {
        background-color: #f9f9f9;
    }

    .results-table tr:hover td:nth-child(3) {
        background-color: #e0f2fe;
    }

    /* Hide tour column on very small screens to show names first */
    .results-table th:nth-child(1),
    .results-table td:nth-child(1) {
        display: none;
    }

    .results-table th:nth-child(15), /* Email */
    .results-table td:nth-child(15) {
        min-width: 120px;
    }

    .show-more-button {
        padding: 10px 24px;
        font-size: 13px;
        width: 100%;
        max-width: 300px;
    }

    .no-results {
        padding: 30px 20px;
        font-size: 14px;
    }
}

/* Extra small mobile (iPhone SE, etc) - up to 375px */
@media screen and (max-width: 375px) {
    .logo-image {
        width: 50px;
        height: 50px;
    }

    .logo-title {
        font-size: 1.3em;
    }

    .logo-subtitle {
        font-size: 0.75em;
    }

    .search-instructions {
        font-size: 0.8em;
    }

    .results-table {
        font-size: 8px;
    }

    .results-table th,
    .results-table td {
        padding: 4px 2px;
        font-size: 8px;
        min-width: 50px;
    }

    /* Keep sticky columns slightly smaller on very small screens */
    .results-table th:nth-child(2),
    .results-table td:nth-child(2) {
        min-width: 75px;
        max-width: 75px;
        left: 0;
    }

    .results-table th:nth-child(3),
    .results-table td:nth-child(3) {
        min-width: 75px;
        max-width: 75px;
        left: 75px;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .results-container {
        /* Natural scrolling in landscape too */
    }

    .header {
        padding: 10px;
    }

    .logo-container {
        margin-bottom: 10px;
    }

    .logo-title {
        font-size: 1.3em;
    }

    .search-instructions {
        margin-bottom: 8px;
    }
}