/* ===============================
   GLOBAL STYLES
================================ */
.omnieditor-notes-board {
    max-width: 100%;
    box-sizing: border-box;
}

/* ===============================
   TOUR STYLES
================================ */
#omnieditor-tour {
    margin: 20px 0;
    padding: 20px;
    border-left: 4px solid #2271b1;
    display: none; /* Hidden by default, shown by JS */
}

#omnieditor-tour h3 {
    margin-top: 0;
    color: #1d2327;
}

#omnieditor-tour ol {
    margin: 15px 0 20px 20px;
    padding: 0;
}

#omnieditor-tour li {
    margin-bottom: 8px;
    color: #3c434a;
}

#dismiss-tour {
    margin-top: 10px;
}

/* ===============================
   NOTIFICATIONS
================================ */
.omnieditor-notification {
    position: relative;
    padding: 12px 40px 12px 20px;
    margin: 0 0 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid;
    font-size: 14px;
}

.omnieditor-notification-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.omnieditor-notification-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.omnieditor-notification-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.omnieditor-notification-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.notification-message {
    display: block;
    line-height: 1.5;
}

.notification-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    opacity: 0.7;
    line-height: 1;
}

.notification-dismiss:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===============================
   STATE MISMATCH MODAL
================================ */
.state-mismatch-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.state-mismatch-modal .modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.state-mismatch-modal h3 {
    color: #d63638;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.state-mismatch-modal p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #3c434a;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===============================
   LOADING STATES
================================ */
.card-loading {
    position: relative;
    opacity: 0.7 !important;
}

.card-loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    z-index: 10;
    color: #2271b1;
    font-weight: 500;
}

.card-loading-indicator .spinner {
    float: none;
    margin: 0;
    width: 20px;
    height: 20px;
}

.card-dragging {
    opacity: 0.8;
    transform: rotate(2deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    z-index: 100;
}

.card-success {
    animation: successPulse 1s ease;
    border-color: #00a32a !important;
    box-shadow: 0 0 0 2px rgba(0, 163, 42, 0.2) !important;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.board-refreshing {
    position: relative;
}

.board-refreshing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 5;
    border-radius: 10px;
}

/* ===============================
   KANBAN BOARD
================================ */
.kanban-board {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    min-height: 500px;
}

/* ===============================
   KANBAN COLUMN
================================ */
.kanban-column {
    background: #f9fafb;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 15px;
    width: 25%;
    min-width: 280px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    transition: all 0.3s ease;
}

.kanban-column:hover {
    border-color: #c3c4c7;
}

/* Column headers with status colors */
.column-title {
    margin: 0 0 15px;
    padding-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid;
    color: #1d2327;
}

.column-new .column-title {
    border-bottom-color: #72aee6;
    color: #72aee6;
}

.column-orphan .column-title {
    border-bottom-color: #d63638;
    color: #d63638;
}

.column-resolved .column-title {
    border-bottom-color: #00a32a;
    color: #00a32a;
}

.column-trash .column-title {
    border-bottom-color: #8c8f94;
    color: #8c8f94;
}

.column-count {
    font-size: 14px;
    font-weight: normal;
    color: #646970;
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    min-width: 30px;
    text-align: center;
}

/* Column-specific backgrounds */
.column-new {
    background: #f9fafb;
}

.column-orphan {
    background: #fff6f6;
}

.column-resolved {
    background: #f3f8f3;
}

.column-trash {
    background: #f7f7f7;
    opacity: 0.9;
}

/* ===============================
   KANBAN CARDS
================================ */
.kanban-cards {
    flex: 1;
    min-height: 200px;
    margin-top: 10px;
    position: relative;
}

/* ===============================
   INDIVIDUAL CARD
================================ */
.kanban-card {
    background: #ffffff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

/* Card status indicators */
.kanban-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 8px 0 0 8px;
}

.kanban-card[data-column="new"]::before {
    background: #72aee6;
}

.kanban-card[data-column="orphan"]::before {
    background: #d63638;
}

.kanban-card[data-column="resolved"]::before {
    background: #00a32a;
}

.kanban-card[data-column="trash"]::before {
    background: #8c8f94;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #2271b1;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Card content */
.card-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #1d2327;
    word-break: break-word;
}

/* Card meta */
.card-meta {
    font-size: 12px;
    color: #646970;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.post-title {
    font-weight: 600;
}

.author {
    color: #2271b1;
}

.date {
    color: #8c8f94;
}

/* Card actions */
.card-actions {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}

.card-actions a {
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-actions a:hover {
    text-decoration: underline;
    color: #135e96;
}

/* ===============================
   DRAG & DROP
================================ */
.omnieditor-card-placeholder {
    border: 2px dashed #2271b1;
    background: #f0f6fc;
    border-radius: 8px;
    height: 80px;
    margin-bottom: 12px;
    visibility: visible !important;
}

.ui-sortable-helper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* ===============================
   EMPTY STATE
================================ */
.kanban-column .empty {
    text-align: center;
    padding: 40px 20px;
    color: #8c8f94;
    font-style: italic;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 2px dashed #dcdcde;
    margin: 0;
}

/* ===============================
   FILTERS
================================ */
.omnieditor-filters {
    background: #f9fafb;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #646970;
}

.filters select,
.filters input[type="search"] {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    background: white;
}

.filters select:focus,
.filters input[type="search"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

.clear-filters {
    margin-left: 10px;
}

/* ===============================
   RESPONSIVE DESIGN
================================ */
@media screen and (max-width: 1200px) {
    .kanban-board {
        flex-wrap: wrap;
    }
    
    .kanban-column {
        width: calc(50% - 10px);
        min-width: 300px;
    }
}

@media screen and (max-width: 782px) {
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        width: 100%;
        min-width: auto;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filters select,
    .filters input[type="search"] {
        min-width: auto;
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .kanban-card {
        padding: 12px;
    }
    
    .column-title {
        font-size: 15px;
    }
    
    .card-content {
        font-size: 13px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* ===============================
   DARK MODE SUPPORT
================================ */
@media (prefers-color-scheme: dark) {
    #omnieditor-tour {
        background: #2c3338;
        border-color: #72aee6;
        color: #f0f0f1;
    }
    
    #omnieditor-tour h3 {
        color: #f0f0f1;
    }
    
    #omnieditor-tour li {
        color: #dcdcde;
    }
    
    .omnieditor-notification {
        background: #2c3338;
    }
    
    .omnieditor-notification-success {
        background-color: rgba(40, 167, 69, 0.2);
        border-color: #28a745;
        color: #d4edda;
    }
    
    .omnieditor-notification-error {
        background-color: rgba(220, 53, 69, 0.2);
        border-color: #dc3545;
        color: #f8d7da;
    }
    
    .state-mismatch-modal .modal-content {
        background: #1d2327;
        color: #f0f0f1;
    }
    
    .state-mismatch-modal p {
        color: #dcdcde;
    }
    
    .kanban-column {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .kanban-card {
        background: #1d2327;
        border-color: #3c434a;
    }
    
    .card-content {
        color: #f0f0f1;
    }
    
    .card-meta {
        color: #a7aaad;
    }
    
    .omnieditor-filters {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .filters select,
    .filters input[type="search"] {
        background: #2c3338;
        border-color: #4f555c;
        color: #f0f0f1;
    }
    
    .kanban-column .empty {
        background: rgba(255, 255, 255, 0.05);
        border-color: #4f555c;
        color: #a7aaad;
    }
    
    .card-loading-indicator {
        background: rgba(45, 45, 45, 0.9);
        color: #72aee6;
    }
}

/* ===============================
   REDUCED MOTION
================================ */
@media (prefers-reduced-motion: reduce) {
    .omnieditor-notification,
    .state-mismatch-modal,
    .kanban-card,
    .card-success {
        animation: none;
        transition: none;
    }
    
    .kanban-card:hover {
        transform: none;
    }
}


/* State-specific hover effects */
.kanban-card[data-column="new"]:hover {
    border-color: #72aee6;
}

.kanban-card[data-column="resolved"]:hover {
    border-color: #00a32a;
}

.kanban-card[data-column="orphan"]:hover {
    border-color: #d63638;
}

.kanban-card[data-column="trash"] {
    opacity: 0.7;
}

.kanban-card[data-column="trash"]:hover {
    opacity: 0.9;
    border-color: #8c8f94;
}

/* Disabled state for trash column */
.kanban-column[data-column="trash"] .kanban-card {
    cursor: not-allowed;
}

.kanban-column[data-column="trash"] .kanban-card:hover {
    transform: none;
    box-shadow: none;
}

/* ===============================
   STATS PANEL
================================ */
.omnieditor-stats-panel {
    background: #f9fafb;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.omnieditor-stats-panel h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 10px;
}

.omnieditor-stats-panel h3:before {
    content: 'ðŸ“Š';
    font-size: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.stat-new::before {
    background: linear-gradient(90deg, #72aee6, #4a8bc8);
}

.stat-resolved::before {
    background: linear-gradient(90deg, #00a32a, #007c22);
}

.stat-orphan::before {
    background: linear-gradient(90deg, #d63638, #b32d2e);
}

.stat-trash::before {
    background: linear-gradient(90deg, #8c8f94, #6c6f73);
}

.stat-count {
    display: block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    color: #1d2327;
}

.stat-new .stat-count {
    color: #72aee6;
}

.stat-resolved .stat-count {
    color: #00a32a;
}

.stat-orphan .stat-count {
    color: #d63638;
}

.stat-trash .stat-count {
    color: #8c8f94;
}

.stat-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .omnieditor-stats-panel {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .omnieditor-stats-panel h3 {
        color: #f0f0f1;
    }
    
    .stat-card {
        background: #1d2327;
        border-color: #3c434a;
    }
    
    .stat-count {
        color: #f0f0f1 !important;
    }
    
    .stat-label {
        color: #a7aaad;
    }
}
.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

/* ===============================
   STATS PANEL WITH BOXES & COLORS
================================ */
.omnieditor-stats-panel {
    background: #f9fafb;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.omnieditor-stats-panel h3 {
    margin: 0 0 25px;
    font-size: 20px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.omnieditor-stats-panel h3:before {
    content: '📊';
    font-size: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Colored top borders */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.stat-new::before {
    background: linear-gradient(90deg, #72aee6, #4a8bc8);
}

.stat-resolved::before {
    background: linear-gradient(90deg, #00a32a, #007c22);
}

.stat-orphan::before {
    background: linear-gradient(90deg, #d63638, #b32d2e);
}

.stat-trash::before {
    background: linear-gradient(90deg, #8c8f94, #6c6f73);
}

/* Count styling */
.stat-count {
    display: block;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.stat-new .stat-count {
    color: #72aee6;
    text-shadow: 0 2px 4px rgba(114, 174, 230, 0.15);
}

.stat-resolved .stat-count {
    color: #00a32a;
    text-shadow: 0 2px 4px rgba(0, 163, 42, 0.15);
}

.stat-orphan .stat-count {
    color: #d63638;
    text-shadow: 0 2px 4px rgba(214, 54, 56, 0.15);
}

.stat-trash .stat-count {
    color: #8c8f94;
    text-shadow: 0 2px 4px rgba(140, 143, 148, 0.15);
}

/* Label styling */
.stat-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Icon styling */
.stat-icon {
    font-size: 28px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.9;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .omnieditor-stats-panel {
        background: #2c3338;
        border-color: #3c434a;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    
    .omnieditor-stats-panel h3 {
        color: #f0f0f1;
    }
    
    .stat-card {
        background: #1d2327;
        border-color: #3c434a;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    .stat-card:hover {
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    }
    
    .stat-count {
        color: #f0f0f1 !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    }
    
    .stat-label {
        color: #a7aaad;
    }
}