/**
 * Public styles for Guidebook Viewer
 *
 * @package Guidebook_Viewer
 * @since 1.0.0
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Base styles and reset */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

body {
    background-color: #f8f9fa;
}

.guidebook-viewer-container {
    background: transparent;
    min-height: 100vh;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.guidebook-main-container {
    background: transparent;
    min-height: 100vh;
    padding: 40px 20px;
    margin: 0;
    overflow-x: hidden;
}

.guidebook-shared-header {
    background: linear-gradient(135deg, #8B0000, #FF4500);
    color: white;
    padding: 15px 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
}

.guidebook-logo-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.guidebook-header-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.guidebook-header-subtitle {
    font-size: 1rem;
    margin: 0 0 8px 0;
    opacity: 0.9;
}

.guidebook-ai-notice-header {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 5px;
}

.guidebook-content-wrapper {
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.guidebook-selection-section {
    width: 350px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #FF4500;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.guidebook-pdf-section {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.guidebook-selection-card {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    margin-bottom: 0;
    position: relative;
    overflow: visible;
}

.guidebook-selection-card > * {
    position: relative;
    z-index: 1;
}

.guidebook-card-header {
    background: linear-gradient(135deg, #8B0000, #FF4500);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    margin-bottom: 0;
}

.guidebook-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.guidebook-card-subtitle {
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    opacity: 0.9;
}

.guidebook-ai-notice-only {
    background: linear-gradient(135deg, #8B0000, #FF4500);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
}

.guidebook-selection-credits {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.info-icon {
    margin-right: 8px;
    font-size: 0.8rem;
    color: #6c757d;
    display: inline-block;
}

.guidebook-pdf-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.guidebook-pdf-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.guidebook-credits-info {
    font-size: 0.85rem;
    color: #6c757d;
}

.guidebook-credits-link {
    color: #FF4500;
    text-decoration: none;
    font-weight: 600;
}

.guidebook-credits-link:hover {
    color: #8B0000;
    text-decoration: underline;
}

.guidebook-card-body {
    padding: 2rem;
}

.guidebook-logo-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.guidebook-card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.guidebook-card-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
    color: #ffffff;
}

.guidebook-ai-notice {
    background: linear-gradient(135deg, #FF6B35, #FF8C00);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.guidebook-form-label {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.guidebook-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.guidebook-card {
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    min-height: 180px;
    max-width: 100%;
}

.guidebook-card:hover {
    border-color: #FF4500;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.3);
}

.guidebook-card.selected {
    border-color: #FF4500;
    background: #fff5f0;
    color: #333;
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 10px 30px rgba(255, 69, 0, 0.4);
}

.guidebook-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(135deg, #FF4500, #FF6B35);
    border-radius: 20px 20px 0 0;
    z-index: 3;
}

.guidebook-cover-container {
    position: relative;
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 15px 15px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.guidebook-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.2s ease;
    border-radius: 15px 15px 0 0;
}

.guidebook-card:hover .guidebook-cover {
    transform: scale(1.05);
}

.guidebook-card.selected .guidebook-cover {
    transform: scale(1.02);
}

.guidebook-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.guidebook-badge {
    background: rgba(255, 69, 0, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
    align-self: flex-end;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.guidebook-card:hover .guidebook-badge {
    opacity: 1;
    transform: translateY(0);
}

.guidebook-card.selected .guidebook-badge {
    opacity: 1;
    transform: translateY(0);
    background: rgba(255, 69, 0, 1);
}

.guidebook-content {
    position: relative;
    z-index: 2;
    background: transparent;
    color: #333;
    padding: 15px;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.guidebook-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    color: #333;
}

.guidebook-desc {
    font-size: 0.8rem;
    opacity: 0.9;
    color: white;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.guidebook-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.guidebook-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.guidebook-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.guidebook-desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

.guidebook-language-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.guidebook-language-option {
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    position: relative;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.guidebook-language-option:hover {
    border-color: #FF4500;
    background: #fff5f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.2);
}

.guidebook-language-option.selected {
    border-color: #FF4500;
    background: linear-gradient(135deg, #FF4500, #FF6B35);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.guidebook-language-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.guidebook-language-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.guidebook-flag-container {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.guidebook-language-option.selected .guidebook-flag-container {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.guidebook-language-flag {
    font-size: 1.2rem;
    display: block;
}

.guidebook-language-info {
    text-align: left;
}

.guidebook-language-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

.guidebook-language-code {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.guidebook-btn-primary {
    background: linear-gradient(135deg, #8B0000, #FF4500);
    border: 2px solid #FF4500;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.guidebook-btn-primary:hover {
    background: linear-gradient(135deg, #FF4500, #FF6B35);
    border-color: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

.guidebook-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.guidebook-pdf-viewer-container {
    background: white;
    border: 2px solid #FF4500;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
    padding: 0;
    min-height: 600px;
    position: relative;
}

.guidebook-selection-section {
    position: relative;
}

.guidebook-pdf-info {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.guidebook-pdf-info h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.guidebook-pdf-iframe {
    width: 100%;
    height: 85vh;
    border: none;
    display: block;
}

.guidebook-no-selection {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    background: #f8f9fa;
}

.guidebook-no-selection-content {
    text-align: center;
}

.guidebook-no-selection-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.guidebook-credits-section {
    margin-top: 30px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.guidebook-credits-content {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 20px;
}

.guidebook-credits-text {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.guidebook-credits-link {
    color: #FF4500;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.guidebook-credits-link:hover {
    color: #8B0000;
    text-decoration: underline;
}

.guidebook-no-selection-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.guidebook-no-selection-content p {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.guidebook-no-selection i {
    font-size: 3rem;
    color: #FF4500;
    margin-bottom: 1rem;
}

.guidebook-alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 1rem;
}

.guidebook-fade-in {
    animation: guidebook-fadeIn 0.6s ease-in;
}

@keyframes guidebook-fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* PDF Viewer CSS */
.pdf-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    border-radius: 8px;
    display: block;
}

.pdf-toolbar {
    background: linear-gradient(135deg, #8B0000, #FF4500);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-height: 60px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.page-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
}

.page-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    background: rgba(255,255,255,0.1);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.zoom-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    min-width: 30px;
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.2);
}

.zoom-display {
    background: rgba(255,255,255,0.1);
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 45px;
    text-align: center;
}

.pdf-pages-container {
    padding: 20px;
    padding-top: 80px; /* Add space for fixed header */
    text-align: center;
    background: white;
    min-height: calc(100vh - 80px);
    width: 100%;
    display: block;
}

.pdf-page {
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    position: relative;
    display: block;
    max-width: 100%;
}

.pdf-page canvas {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px auto;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #666;
    font-size: 16px;
}

.loading-bar {
    width: 300px;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px auto;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.load-more-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin: 20px auto;
    display: block;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

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


/* pdf Viewer Container .css */
.guidebook-pdf-viewer-container {
    border: 2px solid #FF4500;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    position: relative;
}

.guidebook-pdf-viewer-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guidebook-pdf-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.guidebook-pdf-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.guidebook-pdf-controls {
    display: flex;
    gap: 10px;
}

.guidebook-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.guidebook-btn:hover {
    background: #f8f9fa;
    border-color: #FF4500;
}

.guidebook-btn-primary {
    background: #FF4500;
    color: white;
    border-color: #FF4500;
}

.guidebook-btn-primary:hover {
    background: #e03e00;
    border-color: #e03e00;
}

.guidebook-pdf-viewer-content {
    position: relative;
}

.guidebook-pdf-iframe {
    border: none;
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    background: white;
}

.guidebook-no-pdf {
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 15px;
}

.guidebook-no-pdf-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.guidebook-no-pdf h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.guidebook-no-pdf p {
    margin: 0 0 20px 0;
    color: #666;
}

.guidebook-no-pdf-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Font Awesome Audio Player Button Fix */
#uc_audio_player_mejs_elementor_71ea536 .mejs__play>button::before {
    content: "\f04b" !important; /* Font Awesome play icon */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    line-height: 16px !important;
    display: inline-block !important;
}

/* Alternative fix for any audio player button */
.mejs__play>button::before {
    content: "\f04b" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    line-height: 16px !important;
}

/* Ensure Font Awesome is properly loaded */
.fa, .fas, .far, .fal, .fab {
    font-family: "Font Awesome 6 Free" !important;
}

/* Additional audio player fixes */
.mejs__button::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Fix for any missing Font Awesome icons */
[class*="fa-"]::before,
[class^="fa-"]::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}