/* ============================================
   MISSIONARY LETTERS - CUSTOM STYLES
   Matching Sarnia Gospel Hall Website Theme
   ============================================ */

/* Error Messages */
.sgh-ml-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.sgh-ml-error p {
    margin: 0 0 15px 0;
}

.sgh-ml-error a {
    display: inline-block;
    padding: 12px 24px;
    background: rgb(34, 118, 191);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sgh-ml-error a:hover {
    background: rgba(40, 175, 224, 0.9);
    transform: translateY(-2px);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.sgh-ml-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.sgh-ml-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
}

.sgh-ml-modal-content-wrapper {
    position: relative;
    background: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    animation: sgh-ml-modal-slide-down 0.3s ease;
}

.sgh-ml-modal-large {
    max-width: 800px;
    width: 90%;
}

@keyframes sgh-ml-modal-slide-down {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sgh-ml-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e0e0e0;
    background-color: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.sgh-ml-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sgh-ml-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: color 0.3s ease;
}

.sgh-ml-modal-close:hover {
    color: #333;
}

.sgh-ml-modal-body {
    padding: 30px;
}

/* Remove extra wrapper styling when in modal */
.sgh-ml-modal-body .sgh-ml-upload-wrapper {
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
}

/* Prevent body scroll when modal is open */
body.sgh-ml-modal-open {
    overflow: hidden;
}

/* Upload Form Wrapper */
.sgh-ml-upload-wrapper {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

/* Messages/Alerts */
.sgh-ml-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

.sgh-ml-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sgh-ml-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sgh-ml-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
}

/* Form Groups */
.sgh-ml-form-group {
    margin-bottom: 25px;
}

.sgh-ml-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.sgh-ml-form-group .required {
    color: #e74c3c;
}

.sgh-ml-form-group input[type="text"],
.sgh-ml-form-group textarea,
.sgh-ml-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sgh-ml-form-group input[type="text"]:focus,
.sgh-ml-form-group textarea:focus,
.sgh-ml-form-group select:focus {
    outline: none;
    border-color: rgb(34, 118, 191);
    box-shadow: 0 0 0 3px rgba(34, 118, 191, 0.1);
}

.sgh-ml-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Custom Toggle Switch - Formidable Forms Style */
.sgh-ml-toggle-wrapper {
    margin-top: 10px;
}

.frm_switch_block {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.frm_switch_block input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.frm_switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #ddd;
    border-radius: 26px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.frm_slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.frm_switch_block input[type="checkbox"]:checked ~ .frm_switch {
    background-color: rgb(34, 118, 191);
}

.frm_switch_block input[type="checkbox"]:checked ~ .frm_switch .frm_slider {
    transform: translateX(24px);
}

.frm_switch_opt {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* File Upload Drop Zone */
.sgh-ml-file-upload {
    position: relative;
}

.sgh-ml-file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.sgh-ml-file-drop-zone:hover,
.sgh-ml-file-drop-zone.sgh-ml-drag-over {
    border-color: rgb(34, 118, 191);
    background-color: rgba(34, 118, 191, 0.05);
}

.sgh-ml-upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: rgb(34, 118, 191);
}

.sgh-ml-drop-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.sgh-ml-file-info {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.sgh-ml-file-drop-zone input[type="file"] {
    display: none;
}

/* File Preview - Multiple Files */
.sgh-ml-file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sgh-ml-file-preview-item {
    padding: 12px 15px;
    background-color: #f0f8ff;
    border: 1px solid rgb(34, 118, 191);
    border-radius: 6px;
}

.sgh-ml-file-preview {
    padding: 15px 20px;
    background-color: #f0f8ff;
    border: 1px solid rgb(34, 118, 191);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sgh-ml-file-preview-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.sgh-ml-file-icon-small {
    width: 24px;
    height: 24px;
    color: rgb(34, 118, 191);
    flex-shrink: 0;
}

.sgh-ml-file-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.sgh-ml-file-name {
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.sgh-ml-file-size {
    font-size: 13px;
    color: #666;
}

.sgh-ml-remove-file,
.sgh-ml-remove-file-item {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.sgh-ml-remove-file:hover,
.sgh-ml-remove-file-item:hover {
    color: #c0392b;
}

.sgh-ml-clear-all-files {
    margin-top: 10px;
    padding: 8px 16px;
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.sgh-ml-clear-all-files:hover {
    background: #c9302c;
}

/* File Actions Row */
.sgh-ml-file-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.sgh-ml-add-more-files {
    padding: 10px 18px;
    background: rgb(34, 118, 191);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sgh-ml-add-more-files:hover {
    background: rgba(40, 175, 224, 0.9);
    transform: translateY(-1px);
}

.sgh-ml-clear-all-files {
    padding: 10px 18px;
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 0;
}

.sgh-ml-clear-all-files:hover {
    background: #c9302c;
    transform: translateY(-1px);
}

/* Submit Button */
.sgh-ml-form-actions {
    margin-top: 30px;
    text-align: left;
}

.sgh-ml-submit-btn {
    background-color: rgb(34, 118, 191);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sgh-ml-submit-btn:hover {
    background-color: rgba(40, 175, 224, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 118, 191, 0.3);
}

.sgh-ml-submit-btn:disabled {
    background-color: rgb(165, 165, 165);
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   LETTERS DISPLAY GRID
   ============================================ */

.sgh-ml-letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.sgh-ml-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Letter Card */
.sgh-ml-letter-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sgh-ml-letter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Letter Header */
.sgh-ml-letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.sgh-ml-category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgh-ml-category-missionary {
    background-color: #A6E7CF;
    color: #0a5f3f;
}

.sgh-ml-category-preacher {
    background-color: #FFD3B6;
    color: #8b4513;
}

.sgh-ml-date {
    font-size: 13px;
    color: #666;
}

/* Letter Content */
.sgh-ml-letter-title {
    padding: 20px 20px 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.sgh-ml-letter-from {
    padding: 0 20px;
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
}

.sgh-ml-letter-intro {
    padding: 0 20px 15px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    flex-grow: 1;
}

.sgh-ml-read-more-dots {
    color: #555;
}

.sgh-ml-read-more-link {
    color: rgb(34, 118, 191);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sgh-ml-read-more-link:hover {
    color: rgba(40, 175, 224, 0.9);
    text-decoration: underline;
}

/* Letter Actions */
.sgh-ml-letter-actions {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

.sgh-ml-view-btn,
.sgh-ml-download-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sgh-ml-view-btn svg,
.sgh-ml-download-btn svg {
    width: 18px;
    height: 18px;
}

.sgh-ml-view-btn {
    background-color: rgb(34, 118, 191);
    color: white;
}

.sgh-ml-view-btn:hover {
    background-color: rgba(40, 175, 224, 0.9);
    transform: translateY(-1px);
}

.sgh-ml-download-btn {
    background-color: white;
    color: rgb(34, 118, 191);
    border: 2px solid rgb(34, 118, 191);
}

.sgh-ml-download-btn:hover {
    background-color: rgb(34, 118, 191);
    color: white;
    transform: translateY(-1px);
}

/* ============================================
   LIGHTBOX FOR IMAGES
   ============================================ */

.sgh-ml-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    cursor: pointer;
}

.sgh-ml-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 2% auto;
    text-align: center;
}

.sgh-ml-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.sgh-ml-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.sgh-ml-lightbox-close:hover {
    color: #ccc;
}

/* ============================================
   SINGLE LETTER PAGE
   ============================================ */

.sgh-single-letter-wrapper {
    background: #f9f9f9;
    padding: 40px 0;
}

/* When displayed as a page within WordPress theme */
.sgh-single-letter-page {
    margin: 0 -20px; /* Extend to edges if theme has padding */
}

/* Hide default WordPress page title if theme shows it */
body.sgh-missionary-letter-single .entry-title,
body.sgh-missionary-letter-single .page-title {
    display: none;
}

.sgh-single-letter-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.sgh-single-letter-nav {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sgh-single-letter-nav-bottom {
    margin-top: 40px;
    margin-bottom: 0;
}

.sgh-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: rgb(34, 118, 191);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sgh-back-btn svg {
    width: 20px;
    height: 20px;
}

.sgh-back-btn:hover {
    background: rgb(34, 118, 191);
    color: white;
    transform: translateX(-3px);
}

/* Admin Edit Button */
.sgh-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0ad4e;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sgh-edit-btn svg {
    width: 18px;
    height: 18px;
}

.sgh-edit-btn:hover {
    background: #ec971f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Letter Header */
.sgh-single-letter-header {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sgh-single-letter-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sgh-single-category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgh-single-category-missionary {
    background-color: #A6E7CF;
    color: #0a5f3f;
}

.sgh-single-category-preacher {
    background-color: #FFD3B6;
    color: #8b4513;
}

.sgh-single-date {
    color: #666;
    font-size: 15px;
}

.sgh-single-letter-title {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.sgh-single-letter-from {
    font-size: 16px;
    color: #555;
    margin: 0 0 20px 0;
}

.sgh-single-letter-intro {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid rgb(34, 118, 191);
    border-radius: 4px;
    margin-bottom: 25px;
}

.sgh-single-letter-actions {
    margin-top: 25px;
}

.sgh-single-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: rgb(34, 118, 191);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.sgh-single-download-btn svg {
    width: 20px;
    height: 20px;
}

.sgh-single-download-btn:hover {
    background-color: rgba(40, 175, 224, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 118, 191, 0.3);
}

/* Letter Content */
.sgh-single-letter-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* PDF Viewer */
.sgh-pdf-viewer {
    width: 100%;
}

.sgh-pdf-viewer iframe {
    width: 100%;
    min-height: 800px;
    border: none;
    border-radius: 8px;
}

.sgh-pdf-fallback {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.sgh-pdf-fallback a {
    color: rgb(34, 118, 191);
    text-decoration: none;
    font-weight: 600;
}

.sgh-pdf-fallback a:hover {
    text-decoration: underline;
}

/* Image Viewer */
.sgh-image-viewer {
    text-align: center;
}

.sgh-letter-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   IMAGE CAROUSEL
   ============================================ */

.sgh-image-carousel {
    width: 100%;
    margin-bottom: 30px;
}

.sgh-carousel-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #000;
}

.sgh-carousel-slide {
    display: none;
    width: 100%;
    text-align: center;
}

.sgh-carousel-slide.active {
    display: block;
}

.sgh-carousel-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 800px;
    object-fit: contain;
}

/* Navigation Arrows */
.sgh-carousel-prev,
.sgh-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.sgh-carousel-prev:hover,
.sgh-carousel-next:hover {
    background: rgba(34, 118, 191, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.sgh-carousel-prev {
    left: 20px;
}

.sgh-carousel-next {
    right: 20px;
}

.sgh-carousel-prev svg,
.sgh-carousel-next svg {
    width: 24px;
    height: 24px;
}

/* Image Counter */
.sgh-carousel-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

/* Thumbnail Navigation */
.sgh-carousel-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.sgh-carousel-thumb {
    flex: 0 0 100px;
    height: 80px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.sgh-carousel-thumb:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.sgh-carousel-thumb.active {
    border-color: rgb(34, 118, 191);
    opacity: 1;
}

.sgh-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* PDF Files Section */
.sgh-pdf-files-section {
    margin-top: 40px;
}

.sgh-pdf-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.sgh-pdf-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sgh-pdf-file-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sgh-pdf-file-item:hover {
    border-color: rgb(34, 118, 191);
    box-shadow: 0 4px 12px rgba(34, 118, 191, 0.15);
    transform: translateY(-2px);
}

.sgh-pdf-icon {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    margin-bottom: 10px;
}

.sgh-pdf-icon svg {
    width: 45px;
    height: 45px;
    color: rgb(34, 118, 191);
}

.sgh-pdf-file-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    word-break: break-word;
    line-height: 1.4;
}

.sgh-pdf-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: rgb(34, 118, 191);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.sgh-pdf-open-btn svg {
    width: 18px;
    height: 18px;
}

.sgh-pdf-open-btn:hover {
    background-color: rgba(40, 175, 224, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 118, 191, 0.3);
}

/* Mobile responsive for PDF grid */
@media screen and (max-width: 600px) {
    .sgh-pdf-files-grid {
        grid-template-columns: 1fr;
    }
}

/* Other Files Section */
.sgh-other-files-section {
    margin-top: 40px;
}

.sgh-other-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.sgh-other-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.sgh-other-file-item {
    background: #f5f5f5;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.sgh-other-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sgh-other-file-item .sgh-file-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    position: relative;
}

.sgh-other-file-item .sgh-file-type-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: rgb(34, 118, 191);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.sgh-other-file-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    word-break: break-word;
}

/* File Download */
.sgh-file-download {
    text-align: center;
    padding: 60px 20px;
}

.sgh-file-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: rgb(34, 118, 191);
}

.sgh-file-icon svg {
    width: 100%;
    height: 100%;
}

.sgh-file-download h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: #333;
}

.sgh-file-download p {
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
}

/* Edit Modal Styles */
.sgh-ml-edit-modal .sgh-ml-modal-title {
    color: #f0ad4e;
}

.sgh-ml-additional-upload-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.sgh-ml-delete-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.sgh-ml-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sgh-ml-delete-btn svg {
    width: 18px;
    height: 18px;
}

.sgh-ml-delete-btn:hover {
    background-color: #c9302c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.3);
}

.sgh-ml-delete-warning {
    background: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Additional Files Section */
.sgh-additional-files {
    margin-top: 40px;
}

.sgh-additional-files-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.sgh-additional-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.sgh-additional-file-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sgh-additional-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sgh-add-file-preview {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
}

.sgh-add-file-pdf,
.sgh-add-file-other {
    flex-direction: column;
    gap: 10px;
}

.sgh-add-file-pdf svg,
.sgh-add-file-other svg {
    width: 64px;
    height: 64px;
    color: rgb(34, 118, 191);
}

.sgh-file-type-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgb(34, 118, 191);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.sgh-add-file-image {
    overflow: hidden;
}

.sgh-add-file-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgh-add-file-info {
    padding: 15px;
}

.sgh-add-file-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    word-break: break-word;
}

.sgh-add-file-actions {
    display: flex;
    gap: 8px;
}

.sgh-add-file-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sgh-add-file-btn svg {
    width: 16px;
    height: 16px;
}

.sgh-add-file-view {
    background: #f0f8ff;
    color: rgb(34, 118, 191);
    border: 1px solid rgb(34, 118, 191);
}

.sgh-add-file-view:hover {
    background: rgb(34, 118, 191);
    color: white;
}

.sgh-add-file-download {
    background: rgb(34, 118, 191);
    color: white;
}

.sgh-add-file-download:hover {
    background: rgba(40, 175, 224, 0.9);
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media screen and (max-width: 768px) {
    .sgh-ml-upload-wrapper {
        padding: 20px;
    }

    .sgh-ml-letters-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sgh-ml-letter-actions {
        flex-direction: column;
    }

    .sgh-ml-form-group input[type="text"],
    .sgh-ml-form-group textarea,
    .sgh-ml-form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .sgh-ml-submit-btn {
        width: 100%;
        justify-content: center;
    }

    /* Single letter page responsive */
    .sgh-single-letter-wrapper {
        padding: 20px 0;
    }

    .sgh-single-letter-header {
        padding: 25px 20px;
    }

    .sgh-single-letter-title {
        font-size: 28px;
    }

    .sgh-single-letter-content {
        padding: 25px 20px;
    }

    .sgh-pdf-viewer iframe {
        min-height: 500px;
    }

    /* Carousel responsive */
    .sgh-carousel-prev,
    .sgh-carousel-next {
        width: 40px;
        height: 40px;
    }

    .sgh-carousel-prev {
        left: 10px;
    }

    .sgh-carousel-next {
        right: 10px;
    }

    .sgh-carousel-prev svg,
    .sgh-carousel-next svg {
        width: 20px;
        height: 20px;
    }

    .sgh-carousel-counter {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .sgh-carousel-thumb {
        flex: 0 0 80px;
        height: 60px;
    }

    .sgh-other-files-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .sgh-ml-letter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sgh-ml-file-drop-zone {
        padding: 30px 15px;
    }

    .sgh-ml-upload-icon {
        width: 50px;
        height: 50px;
    }

    /* Modal responsive adjustments */
    .sgh-ml-modal-content-wrapper {
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }

    .sgh-ml-modal-header {
        padding: 15px 20px;
    }

    .sgh-ml-modal-title {
        font-size: 20px;
    }

    .sgh-ml-modal-body {
        padding: 20px;
    }

    .sgh-ml-modal-close {
        font-size: 28px;
    }
}
