/* LiveBlog Plugin Styles */

/* Container */
#liveblog-container {
    max-width: 800px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Form Styles */
.liveblog-form {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.liveblog-form h3 {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

.liveblog-form-group {
    margin-bottom: 15px;
}

/* WYSIWYG Editor Styles */
.liveblog-editor-container {
    margin-bottom: 15px;
}

.liveblog-editor-container .wp-editor-wrap {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.liveblog-editor-container .wp-editor-wrap:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.liveblog-editor-container .wp-editor-tools {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.liveblog-editor-container .quicktags-toolbar {
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
}

.liveblog-editor-container .quicktags-toolbar input.button {
    margin: 0 2px;
    padding: 4px 8px;
    font-size: 11px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.liveblog-editor-container .quicktags-toolbar input.button:hover {
    background: #f0f0f0;
    border-color: #999;
}

.liveblog-editor-container .mce-tinymce {
    border: none !important;
}

.liveblog-editor-container .mce-toolbar-grp {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
}

.liveblog-editor-container iframe {
    min-height: 150px;
}

/* Legacy textarea styles (fallback) */
.liveblog-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.liveblog-textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.liveblog-form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.liveblog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.liveblog-btn-primary {
    background: #007cba;
    color: white;
}

.liveblog-btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.liveblog-btn-secondary {
    background: #6c757d;
    color: white;
}

.liveblog-btn-secondary:hover:not(:disabled) {
    background: #545b62;
    transform: translateY(-1px);
}

/* Photo upload button - special styling for mobile */
.liveblog-photo-upload-button {
    background: #28a745;
    color: white;
    position: relative;
}

.liveblog-photo-upload-button:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

.liveblog-photo-upload-button .dashicons {
    margin-right: 5px;
}

.liveblog-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.liveblog-status {
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.liveblog-status-visible {
    opacity: 1;
}

.liveblog-status-success {
    color: #28a745;
}

.liveblog-status-error {
    color: #dc3545;
}

.liveblog-status-loading {
    color: #6c757d;
}

.liveblog-form-help {
    margin-top: 5px;
}

.liveblog-form-help small {
    color: #6c757d;
    font-size: 12px;
}

/* Media Gallery Styles */
.liveblog-media-preview {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    display: none;
}

.liveblog-media-preview.show {
    display: block;
}

/* File input (kept for programmatic access) */
.liveblog-file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.liveblog-media-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.liveblog-media-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.liveblog-media-info {
    flex: 1;
    min-width: 0;
}

.liveblog-media-title {
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
    font-size: 14px;
    word-wrap: break-word;
}

.liveblog-media-meta {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.liveblog-media-remove {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.liveblog-media-remove:hover {
    background: #c82333;
}

.liveblog-media-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.liveblog-media-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Content Images */
.liveblog-content .liveblog-entry-image {
    margin: 15px 0;
    text-align: center;
}

.liveblog-content .liveblog-entry-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.liveblog-content .liveblog-entry-image img:hover {
    transform: scale(1.02);
    cursor: pointer;
}

.liveblog-content .liveblog-entry-image-caption {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* Post Thumbnail Styling (for wp_posts featured images) */
.liveblog-post-thumbnail {
    position: relative;
}



/* Entries Container */
.liveblog-entries {
    margin-bottom: 20px;
}

.liveblog-no-entries {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Individual Entry */
.liveblog-entry {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.liveblog-entry:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.liveblog-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f3f4;
}

.liveblog-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.liveblog-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.liveblog-time {
    font-size: 18px;
    color: #6c757d;
    font-style: italic;
}

.liveblog-actions {
    display: flex;
    gap: 5px;
}

.liveblog-delete-btn {
    padding: 5px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.liveblog-delete-btn:hover {
    background: #c82333;
}

.liveblog-delete-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.liveblog-content {
    line-height: 1.4;
    color: #333;
}

.liveblog-content p {
    margin: 0 0 15px 0;
    font-size:18px;
}

.liveblog-content p:last-child {
    margin-bottom: 0;
}

.liveblog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.liveblog-content a {    
    text-decoration: none;
    font-weight: bold;
}

.liveblog-content a:hover {
    text-decoration: underline;
}

/* Refresh Indicator */
.liveblog-refresh-indicator {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    color: #6c757d;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.liveblog-refresh-active {
    opacity: 1;
}

.liveblog-refresh-flash {
    background: #d4edda;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.liveblog-refresh-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.liveblog-refresh-text::before {
    content: "●";
    color: #28a745;
    animation: liveblog-pulse 2s infinite;
}

@keyframes liveblog-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive Design */
@media (max-width: 768px) {
    #liveblog-container {
        margin: 15px 0;
    }
    
    .liveblog-form {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .liveblog-entry {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .liveblog-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .liveblog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .liveblog-form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .liveblog-btn {
        width: 100%;
        text-align: center;
    }
    
    .liveblog-media-item {
        flex-direction: column;
        text-align: center;
    }
    
    .liveblog-media-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .liveblog-upload-area {
        padding: 20px;
    }
    
    .liveblog-upload-icon {
        font-size: 36px;
    }
    
    .liveblog-upload-text {
        font-size: 14px;
    }
}

/* Dark mode support */
/*
@media (prefers-color-scheme: dark) {
    .liveblog-form {
        background: #333;
        border-color: #444;
        color: #e2e8f0;
    }
    
    .liveblog-form h3 {
        color: #e2e8f0;
    }
    
    .liveblog-textarea {
        background: #333;
        border-color: #444;
        color: #e2e8f0;
    }
    
    .liveblog-textarea:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
    }
    
    .liveblog-entry {
        background: #333;
        border-color: #444;
        color: #e2e8f0;
    }
    
    .liveblog-entry-header {
        border-bottom-color: #444;
    }
    
    .liveblog-author {
        color: #e2e8f0;
    }
    
    .liveblog-content {
        color: #e2e8f0;
    }
    
    .liveblog-no-entries {
        background: #333;
        border-color: #444;
        color: #a0aec0;
    }
    
    .liveblog-media-preview {
        background: #444;
        border-color: #555;
    }
    
    .liveblog-media-item {
        background: #333;
        border-color: #555;
    }
    
    .liveblog-media-title {
        color: #e2e8f0;
    }
}
*/

/* Animation for new entries */
@keyframes liveblog-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.liveblog-entry-new {
    animation: liveblog-slide-in 0.5s ease-out;
}

/* Loading states */
.liveblog-loading {
    opacity: 0.6;
    pointer-events: none;
}

.liveblog-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: liveblog-spin 1s linear infinite;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    /* WYSIWYG Editor Mobile Styles */
    .liveblog-editor-container .mce-tinymce {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .liveblog-editor-container .quicktags-toolbar {
        padding: 6px;
        overflow-x: auto;
    }
    
    .liveblog-editor-container .quicktags-toolbar input.button {
        font-size: 10px;
        padding: 3px 6px;
        margin: 0 1px;
    }
    
    .liveblog-editor-container iframe {
        min-height: 120px;
    }
    
    .liveblog-media-item {
        gap: 10px;
    }
    
    .liveblog-media-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .liveblog-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .liveblog-btn {
        width: 100%;
        min-height: 44px; /* iOS minimum touch target */
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 20px;
    }
    
    /* Make photo upload button more prominent on mobile */
    .liveblog-photo-upload-button {
        order: 1; /* Show first */
        background: #28a745;
        font-weight: 600;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .liveblog-media-preview {
        padding: 10px;
    }
}

/* Touch device specific styles */
@media (pointer: coarse) {
    .liveblog-btn,
    .liveblog-remove-media {
        min-height: 44px;
        min-width: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    /* Add high contrast styles if needed */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .liveblog-progress-fill {
        transition: none;
    }
}





@media (min-width: 768px) {
    #liveblog-photo-upload-btn {display: none;}
}



.liveblog-entry-image img {
    margin-bottom: 10px;
}