@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100..900&family=Nunito:ital,wght@0,100..900;1,100..900&display=swap');
* {font-family:'Nunito','Noto Sans Thai';touch-action: manipulation;overflow-x: hidden !important;}
body {
    overflow-x: hidden !important;
 }
header img {height:29px;vertical-align:bottom;}
.event-year {position: absolute;right: 14px;top:4px;z-index: 100000;}
.event-year select {min-width:70px;}
.runevent img {height:30px;}

.reload-top {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 99999; }

.text-bib {
    font-size: 4.5rem !important;
}
.bibno .card-footer {
    padding: 0.75rem 1.25rem;
    background-color: rgba(245, 245, 245) !important;
    border-top: 1px solid rgba(110, 117, 130, 0.2); 
}

#result {background-size: cover;background-position: center center;background-repeat: no-repeat;}
#result .rtitle {text-transform: uppercase;color: #343a40;margin-bottom:15px;}
#result .result-item {display: block;position: relative;padding: 15px 0;background: #333333c4;-webkit-border-radius:5px;-khtml-border-radius:5px;-icab-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;}
#result .result-item h2 {color: #fff;font-size: 25px;font-weight: 700;margin-top: 10px;margin-bottom: 1px;}
#result .result-item .title {color: #fff;font-size: 10pt;font-weight: 300;margin-top: 0;}

#timeline ul {background-color:none;padding:1em 0 1.5em 1em;margin: 0;list-style: none;position: relative;}
#timeline ul::before {content: ' ';height: 100%;width: 2px;background-color: #9e9e9e;position: absolute;top: 0;left: 29px;z-index: -1;}
#timeline li div {display: inline-block;margin: 10px 0;vertical-align: top;}
#timeline .bullet {width: 25px;height: 25px;box-sizing: border-box;border-radius: 50%;background: #fff;z-index: 1;margin-left: 5px;}
#timeline .bullet.fin {border: 2px solid #6BA25B;}
#timeline .bullet.cp {border: 2px solid #D7CDBA;}
#timeline .bullet.none {background:none;border:none;margin:0;margin-right: 1em;}
#timeline .hd1, #timeline .hd2 {width: 30%;font-size: 10pt;color:#17540E;margin:0;text-align:center;}
#timeline .time, #timeline .hd1 {width: 15% !important;font-family: "Ubuntu";font-size: 100%;}
#timeline .desc {width:30%;font-size: 15pt !important;color:#000;font-weight: 400;text-align:center;margin-top:7px;}

.eslippdf {width:100%;height:auto;}
.ecerpdf {width:100%;height:auto;}

.keyform {width:600px;}
.keyform h3 {height:35px;text-align:center;}
.keypad .btn-group {width:100%;}
.btn-key, .btn-del {width:33%;background-color: #47b382;border-color: #ddd;color: #fff;padding:18px 20px;font-size:20pt;font-weight:bold;}
.btn-del {background-color: #dc3545;}
.btn-key:hover, .btn-key:active, .btn-key.hover {background-color: #3d9970;color: #fff;}
.btn-del:hover, .btn-del:active, .btn-del.hover {background-color: #bd2130;color: #fff;}
.btn-spe {background-color: #007bff;border-color: #ddd;color: #fff;}
.btn-spe:hover, .btn-spe:active, .btn-spe.hover {background-color: #3c8dbc;color: #fff;}
.btn-k14 {padding-top:14px;padding-bottom:14px;}

@media screen and (max-width:700px){
  .keyform {width:90%;}
}

.w_load_body_parent {
    position: relative;
}

.w_load_body {
    z-index: 10000;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(233, 233, 232, 0.5);
}

.w_load_body .w_load_content {
    z-index: 10000;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300px;
    background: #fff;
    border-radius: 5px;
    padding: 30px 0;
    text-align: center;
}

.w_load_body .w_load_content span {
    display: inline-block;
    vertical-align: middle;
}

.w_load_body .w_load_content_text {
    overflow: hidden;
    font-size: 200%;
    max-width: 300px;
    margin-left: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w_load_body .w_load_content_text i {
    font-size: 100%;
}

.lh-s {
  line-height: 0.5 !important; }

.application .appscreen {width:100%;}
.application .icon {height:90px;width:auto;}

#loader {
    border: 12px solid #f3f3f3;
    border-radius: 50%;
    border-top: 12px solid #444444;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
}
  
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}
  
.center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

/* ========================================
   Custom Slip Styles - Gallery Card Style
   ======================================== */
.custom-slip-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

/* Gallery Card */
.result-card {
    background: #ffffff;
    border: 1px solid rgba(0,40,100,.12);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Upload Placeholder */
.upload-placeholder {
    background: linear-gradient(135deg, #f6f9fc 0%, #edf2f7 100%);
    border-bottom: 1px solid rgba(0,40,100,.12);
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.upload-placeholder:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
}

.upload-placeholder.has-image {
    padding: 0;
    min-height: auto;
}

.upload-placeholder::before {
    content: '📷';
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.upload-placeholder.has-image::before {
    display: none;
}

.profile-preview {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.upload-placeholder input[type="file"] {
    display: none;
}

.upload-btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin-top: 8px;
    transition: background 0.2s ease;
}

.upload-btn:hover {
    background: #0056b3;
}

.upload-placeholder.has-image .upload-text {
    display: none;
}

.change-image-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.change-image-btn:hover {
    background: white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Card Body */
.result-card .card-body {
    padding: 12px;
}

/* Result Header: BIB : Name */
.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.result-bib {
    color: #dc3545;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.result-name {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

/* Times Section */
.result-times {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 0;
    border-top: 1px solid rgba(0,40,100,.06);
    border-bottom: 1px solid rgba(0,40,100,.06);
}

.time-item {
    flex: 1;
    text-align: center;
}

.time-label {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.time-value {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Ranks Section */
.result-ranks {
    display: flex;
    gap: 8px;
    padding-top: 8px;
}

.rank-item {
    flex: 1;
    text-align: center;
}

.rank-label {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.rank-value {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

/* Responsive */
@media (max-width: 767px) {
    .custom-slip-container {
        padding: 10px;
        max-width: 100%;
    }
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .result-bib {
        font-size: 16px;
    }
    .result-name {
        font-size: 13px;
    }
    .time-value {
        font-size: 12px;
    }
    .rank-value {
        font-size: 13px;
    }
}

/* ========================================
   Result Page Styles
   ======================================== */

/* Reload Button (Test Mode) */
.reload-top {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 99999;
}

.page.test-mode .reload-top {
    top: 45px;
}

/* Test Mode Indicator */
.test-mode-indicator {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.test-mode-indicator i {
    margin-right: 5px;
}

/* Refresh Indicator */
.refresh-indicator {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 6px 12px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Image Loading */
.image-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Container */
.image-container {
    position: relative;
    min-height: 200px;
}

.image-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.eslippdf, .ecerpdf {
    max-width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-loaded {
    opacity: 1;
}

.image-loading-state {
    opacity: 0.7;
}

.file-info {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

.cache-indicator {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin: 5px;
    display: inline-block;
}

/* Tab Styles */
.nav-tabs .nav-link {
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    border-bottom: 3px solid #007bff;
    color: #007bff;
}

.nav-tabs .nav-link:hover {
    border-bottom: 3px solid #6c757d;
}

.tab-content {
    padding-top: 1rem;
}

/* Share Button Container */
.share-button-container {
    padding: 16px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    margin-top: 16px;
}

.share-result-btn {
    min-width: 150px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.share-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Share Modal */
#sharePreviewContainer {
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

#shareCanvas {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Social Share Buttons */
.share-buttons .btn {
    padding: 6px 8px;
    font-size: 12px;
}

.share-buttons .btn i {
    font-size: 20px;
}

.share-buttons .btn small {
    display: block;
    margin-top: 4px;
    font-size: 10px;
}

.btn-facebook {
    background-color: #1877f2;
    color: white;
    border: none;
}

.btn-facebook:hover {
    background-color: #145dbf;
    color: white;
}

/* SweetAlert2 Custom Styles */
.swal2-popup {
    font-size: 0.875rem !important;
}

.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

.swal2-html-container {
    font-size: 0.875rem !important;
}

.swal2-confirm,
.swal2-cancel {
    font-size: 0.875rem !important;
    padding: 0.5rem 1.5rem !important;
}

.swal2-icon {
    width: 4rem !important;
    height: 4rem !important;
}

.swal2-icon .swal2-icon-content {
    font-size: 2.5rem !important;
}