/**
 * FlakFlak - WordPress Plugin CSS
 */

 /* FlakFlak Base Styles */
[id^="flakflak-"], 
[class^="flakflak-"], 
.flakflak-dot, 
.flakflak-comment, 
.flakflak-reply {
    font-family: Helvetica, Arial, sans-serif;
}

/* Commenting cursor styles */
body.flakflak-commenting,
body.flakflak-commenting *:hover {
    cursor: crosshair !important;
}

/* Name Overlay Styles */
#flakflak-name-overlay {
    position: fixed;
    z-index: 1000000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.flakflak-name-container {
    width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.flakflak-name-header {
    padding: 15px 20px;
    background-color: #0073aa;
    color: white;
}

.flakflak-name-header h3 {
    margin: 0;
    font-size: 18px;
}

.flakflak-name-body {
    padding: 20px;
    text-align: center;
}

.flakflak-name-body p {
    margin-bottom: 15px;
    font-size: 16px;
}

#flakflak-name-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

#flakflak-name-submit {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#flakflak-name-submit:hover {
    background-color: #005d8c;
}

/* Comment Form */
#flakflak-container {
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#flakflak-comment-form {
    position: absolute;
    width: 300px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.flakflak-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eee;
    border-radius: 4px 4px 0 0;
}

.flakflak-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

#flakflak-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

#flakflak-close:hover {
    color: #333;
}

.flakflak-body {
    padding: 15px;
}

#flakflak-comment-text {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

/* File Upload Area Styles */
#flakflak-upload-area {
    margin-bottom: 15px;
}

#flakflak-dropzone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
}

#flakflak-dropzone:hover {
    border-color: #999;
    background-color: #f5f5f5;
}

#flakflak-dropzone.dragover {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

#flakflak-dropzone.error {
    border-color: #F44336;
    background-color: rgba(244, 67, 54, 0.1);
}

.flakflak-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.flakflak-upload-icon {
    width: 40px;
    height: 40px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.flakflak-dropzone-inner p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.flakflak-file-types {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 5px;
}

#flakflak-browse-files {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#flakflak-browse-files:hover {
    background-color: #388E3C;
}

/* File Preview Area */
#flakflak-file-preview {
    margin-top: 10px;
}

#flakflak-file-preview h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
}

.flakflak-preview-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flakflak-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    overflow: hidden;
    background-color: #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.flakflak-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flakflak-preview-item .video-placeholder {
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.flakflak-preview-item .flakflak-remove-button {
    opacity: 0;
    display: none;
    position: absolute;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 1;
}

.flakflak-preview-item .flakflak-remove-button:hover {
    background-color: red;
}

.flakflak-preview-item:hover .flakflak-remove-button {
    opacity: 1;
    display: flex;
}

.flakflak-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#flakflak-submit, #flakflak-cancel {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#flakflak-cancel {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #333;
}

#flakflak-submit {
    background-color: #0073aa;
    border: 1px solid #0073aa;
    color: #fff;
}

#flakflak-cancel:hover {
    background-color: #eee;
}

#flakflak-submit:hover {
    background-color: #005d87;
}

#flakflak-submit:disabled {
    background-color: #8cb7cb;
    cursor: not-allowed;
}

/* Comment Dots */
.flakflak-dot {
    position: absolute !important; /* Force absolute positioning */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #007bff;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: none; /* Improve touch device support */
    animation: pulse-fade 1s infinite;
}

.flakflak-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.9);
}

/* Ensure dragging class has high z-index */
.flakflak-dragging {
    z-index: 9999 !important;
    cursor: grabbing !important;
    pointer-events: all !important;
}

/* Status-specific dot styles */
.flakflak-status-open {
    background-color: #FF5733 !important;
    box-shadow: 0 0 5px #FF5733 !important;
}

.flakflak-status-review {
    background-color: #3357FF !important;
    box-shadow: 0 0 5px #3357FF !important;
}

.flakflak-status-closed {
    background-color: #3CAE63 !important;
    box-shadow: 0 0 5px #3CAE63 !important;
}

/* Comment Display */
#flakflak-comments-container {
    position: absolute;
    width: 350px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 999998;
    color: #333;
    font-size: 14px;
}

.flakflak-comment {
    padding: 0;
    margin: 0;
}

.flakflak-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eee;
    border-radius: 4px 4px 0 0;
}

.flakflak-comment-author {
    font-weight: bold;
    color: #333;
}

.flakflak-comment-date {
    font-size: 12px;
    color: #777;
    margin-left: 10px;
}

.flakflak-comment-body {
    padding: 15px 15px 0 15px;
}

.flakflak-comment-body .flakflak-comment-text {
    color: #333;
    padding-bottom: 20px;
}
.flakflak-comment-text {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

.flakflak-comment-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.flakflak-comment-close:hover {
    color: #333;
}

/* Status Styles */
.flakflak-status-container {
    margin: 0 0 15px;
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #ddd;
}

.flakflak-comment[data-status="open"] .flakflak-status-container {
    border-left-color: #FF5733;
}

.flakflak-comment[data-status="review"] .flakflak-status-container {
    border-left-color: #3357FF;
}

.flakflak-comment[data-status="closed"] .flakflak-status-container {
    border-left-color: #3CAE63;
}

.flakflak-status-display {
    font-weight: bold;
}

.flakflak-status-dropdown {
    margin-top: 5px;
    display: flex;
    gap: 5px;
}

.flakflak-status-option {
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid #ddd;
    background-color: #f7f7f7;
}

.flakflak-status-option[data-status="open"] {
    border-color: #FF5733;
    color: #FF5733;
}
.flakflak-status-option[data-status="open"].active {
    background-color: #FF5733;
    color: #fff;
}
.flakflak-status-option[data-status="review"] {
    border-color: #3357FF;
    color: #3357FF;
}
.flakflak-status-option[data-status="review"].active {
    background-color: #3357FF;
    color: #fff;
}
.flakflak-status-option[data-status="closed"] {
    border-color: #3CAE63;
    color: #3CAE63;
}
.flakflak-status-option[data-status="closed"].active {
    background-color: #3CAE63;
    color: #fff;
}

.flakflak-status-option:hover {
    background-color: #eee;
}

/* Replies Styles */
.flakflak-replies-section {
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.flakflak-replies-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.flakflak-replies {
    padding: 0 15px;
}

.flakflak-reply {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.flakflak-reply:last-child {
    border-bottom: none;
}

.flakflak-reply-header {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.flakflak-reply-author {
    font-weight: bold;
}

.flakflak-reply-time {
    font-size: 12px;
    color: #777;
}

.flakflak-reply-text {
    line-height: 1.4;
    font-size: 14px;
    white-space: pre-line;
}

.flakflak-reply-toggle {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #333;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
}

.flakflak-reply-toggle:hover {
    background-color: #eee;
}

.flakflak-reply-form {
    padding: 15px;
    border-top: 1px solid #eee;
}

.flakflak-reply-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.flakflak-reply-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.flakflak-reply-cancel, .flakflak-reply-submit {
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.flakflak-reply-cancel {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #333;
}

.flakflak-reply-submit {
    background-color: #0073aa;
    border: 1px solid #0073aa;
    color: #fff;
}

.flakflak-reply-cancel:hover {
    background-color: #eee;
}

.flakflak-reply-submit:hover {
    background-color: #005d87;
}

.flakflak-reply-submit:disabled {
    background-color: #8cb7cb;
    cursor: not-allowed;
}

/* Toolbar */
#flakflak-toolbar {
    position: fixed;
    left: -280px; /* Start off-screen */
    top: 0;
    height: 100vh;
    width: 280px;
    background-color: rgba(0, 0, 0, 0.9); /* Dark background */
    color: #fff; /* White text for dark background */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    font-family: Helvetica, Arial, sans-serif;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

/* When the toolbar is expanded */
#flakflak-toolbar.expanded {
    transform: translateX(280px);
}

/* Toggle button that stays visible */
.flakflak-toolbar-collapsed {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    font-size: 16px;
    font-weight: bold;
    transition: left 0.3s ease, background-color 0.2s;
    text-decoration: none;
}

/* Move the toggle button to the right edge when toolbar is expanded */
#flakflak-toolbar.expanded + .flakflak-toolbar-collapsed {
    left: 280px;
    border-radius: 0 4px 4px 0;
}

.flakflak-toolbar-collapsed:hover {
    background-color: rgba(0, 0, 0, 1); /* Slightly lighter on hover */
}

/* Style the toggle button content */
.flakflak-toolbar-collapsed span {
    display: block;
    text-align: center;
    line-height: 1;
}

/* Internal structure of the expanded drawer */
.flakflak-toolbar-expanded {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.flakflak-page-section {
    margin-bottom: 0;
}

.flakflak-page-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #444; /* Darker border for dark background */
    color: #fff;
}

.flakflak-status-section {
    margin-bottom: 15px;
}

.flakflak-status-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    color: #e0e0e0; /* Base color */
}

/* Keep status colors bright and clear */
.flakflak-status-title.open {
    color: #FF5733; /* Red for open */
}

.flakflak-status-title.review {
    color: #3357FF; /* Blue for review */
}

.flakflak-status-title.closed {
    color: #3CAE63; /* Green for closed */
}

.flakflak-comments-list {
    margin-left: 15px;
    margin-bottom: 10px;
    color: #333;
}

.flakflak-comment-item {
    padding: 5px 0;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    color: #e0e0e0; /* Light gray for better readability on dark background */
}

.flakflak-comment-item:hover {
    background-color: #333; /* Lighter background on hover for dark theme */
}

.flakflak-comment-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 4px;
}

.flakflak-comment-indicator.open {
    background-color: #FF5733; /* Red for open */
}

.flakflak-comment-indicator.review {
    background-color: #3357FF; /* Blue for review */
}

.flakflak-comment-indicator.closed {
    background-color: #3CAE63; /* Green for closed */
}

.flakflak-comment-text {
    flex: 1;
    font-size: 14px;
    white-space: pre-line;
    color: #e0e0e0; /* Light gray for better readability on dark background */
}

.flakflak-divider {
    height: 1px;
    background-color: #444; /* Darker divider for dark background */
    margin: 15px 0;
}

.flakflak-toggle-container {
    display: flex;
    align-items: center;
}

.flakflak-toggle-label {
    margin-left: 5px;
    font-size: 13px;
    cursor: pointer;
    color: #e0e0e0; /* Match the comment text color */
}

/* Admin Styles */
.flakflak-admin-info, 
.flakflak-admin-instructions {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flakflak-admin-info h2, 
.flakflak-admin-instructions h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Styles for draggable dots */
.flakflak-dot {
    cursor: pointer;
}

/* Show move cursor only when Option key is pressed and hovering over dots */
.flakflak-drag-mode .flakflak-dot:hover,
.flakflak-dot.flakflak-draggable:hover {
    cursor: move;
    cursor: grab;
}

/* During active dragging */
.flakflak-dot.flakflak-dragging {
    cursor: grabbing !important;
}

/* Visual indicator when the dot is draggable */
.flakflak-drag-mode .flakflak-dot:hover,
.flakflak-dot.flakflak-draggable:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Drag mode indicator */
body.flakflak-drag-mode::before {
    content: "Drag Mode (Option Key)";
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
    animation: pulse-fade 2s infinite;
}

@keyframes pulse-fade {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.25); }
}

.flakflak-empty-comments {
    padding: 5px 0;
    font-style: italic;
    color: #999;
    font-size: 13px;
}

.flakflak-other-pages {
    margin-top: 10px;
}

.flakflak-other-page-item {
    padding: 10px 0;
    border-bottom: 1px solid #444; /* Darker border for dark background */
    cursor: pointer;
    transition: background-color 0.2s;
}

.flakflak-other-page-item:hover {
    background-color: #333; /* Lighter background on hover for dark theme */
}

.flakflak-other-page-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #e0e0e0; /* Match the comment text color */
}

.flakflak-other-page-stats {
    font-size: 13px;
    color: #bbb;
}

/* No pages message */
.flakflak-no-pages {
    padding: 10px 0;
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    #flakflak-toolbar {
        width: 240px;
        left: -240px;
    }
    
    #flakflak-toolbar.expanded {
        transform: translateX(240px);
    }
}

/* Keyboard Shortcut Tooltip */
.flakflak-tooltip {
    position: absolute;
    left: 50px;
    width: 280px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.flakflak-toolbar-collapsed:hover .flakflak-tooltip {
    opacity: 1;
    visibility: visible;
}

.flakflak-shortcut {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.flakflak-shortcut:last-child {
    margin-bottom: 0;
}

.flakflak-toolbar-collapsed .flakflak-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 30px;
    line-height: 1;
    background-color: #f1f1f1;
    color: #333;
    border-radius: 4px;
    padding: 4px 10px;
    margin-right: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.flakflak-toolbar-collapsed .flakflak-shortcut-desc {
    display: block;
    font-size: 13px;
    color: #eee;
    flex: 1;
    font-weight: 400;
    text-align: left;
} 