.export-btn.is-loading {
    opacity: 0.8;
    pointer-events: none;
}

.export-btn.is-success {
    background: #4caf50;
    color: #fff;
}

.export-btn.is-error {
    background: #e57373;
    color: #fff;
}
/* AI UX Pattern Organizer - Combined Styles */
/* Styles for both Organizer (index.html) and Comparison (comparison.html) pages */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.modal-content h2 {
    color: #2d2d2d;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.modal-content p {
    color: #666;
    margin-bottom: 24px;
    font-size: 16px;
}

.modal-content input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 24px;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: #7d7064;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.save-btn {
    background: #7d7064;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.save-btn:hover {
    background: #6b6258;
}

.save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Current user column styling */
.current-user-cell {
    background-color: #f8f5f2 !important;
    border-left: 3px solid #7d7064 !important;
}

.current-user-cell strong {
    color: #7d7064;
}

/* New status types */
.status-tag.current-user-only {
    background: #e8f5e8;
    color: #2d5a2d;
}

.status-tag.unmapped {
    /* background: #f5f5f5; */
    color: #acacac;
}

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff9f5;
    min-height: 100vh;
    line-height: 1.4;
}

/* Container Layouts */
.container {
    display: flex;
    width: 100%;
    height: 100vh;
    background: #fff9f5;
    border-radius: 0;
    overflow: hidden;
}

/* Organizer specific container layout */
body.organizer .container {
    display: flex;
}

/* Comparison specific container layout */
body.comparison .container {
    display: block;
    background: #fff9f5;
    padding: 32px 40px;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    background: #fff9f5;
    border-radius: 0;
}

.sidebar {
    width: 400px;
    background: #fff;
    border-left: 1.5px solid #e4dad1;
    padding: 32px 24px;
    overflow-y: auto;
    border-radius: 0px;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header img {
    height: 40px;
    width: 40px;
    border-radius: 200px;
}

.header-title:hover {
    transform: translateY(-1px);
}

.header-title:hover h1 {
    color: #5f5f5f;
}

.header-title:hover .chevron-icon {
    color: #5f5f5f !important;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: #151515;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: #151515;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
}

/* Button Styles */
.export-btn, .cache-btn.clear, .compare-btn {
    background: #f2ebe5;
    color: #7d7064;
    border: none;
    padding: 8px 22px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;   
}

.export-btn {
    background: #121212;
    color: #fff;
    transition: all 0.2s;
}

.compare-btn {
    background: #7d7064;
    color: #fff;
}

.export-btn:hover{
    background: #373737;
    transform: translateY(-1px);
    
}

.cache-btn.clear:hover {
    background: #e4dad1;
    color: #151515;
    transform: translateY(-1px);
}

.compare-btn:hover {
    background: #5f5f5f;
    color: #fff;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* Organizer Specific Styles */
.sidebar h2 {
    font-size: 20px;
    font-weight: 600;
    color: #151515;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.sidebar-stats {
    font-size: 15px;
    color: #7d7064;
    text-align: right;
    font-weight: 500;
}

.interactions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.interaction-item {
    background: #f8f8f8;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px 8px 8px 8px;
    cursor: grab;
    transition: all 0.2s;
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    box-shadow: none;
}

.interaction-meta {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #e4dad1;
}

.interaction-title {
    font-weight: 500;
    color: #151515;
    font-size: 14px;
}

.interaction-link {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: #e4dad1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #7d7064;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.interaction-item:hover .interaction-link {
    opacity: 1;
}

.interaction-item:hover {
    border-color: #7d7064;
    background: #f7f3ee;
    transform: translateY(-1px);
}

.interaction-item:active {
    cursor: grabbing;
}

.interaction-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.pattern-section {
    margin-bottom: 36px;
}

.stage-header {
    background: #F7E9DD;
    padding: 18px 20px;
    margin-bottom: 18px;
    position: sticky;
    top: -32px;
    z-index: 2;
    background: #F7E9DD;
}

.stage-title {
    font-size: 22px;
    font-weight: 600;
    color: #151515;
}

.principle-group {
    margin-bottom: 28px;
}

.principle-header {
    font-size: 16px;
    font-weight: 500;
    color: #151515;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1.5px solid #e4dad1;
}

.pattern-row {
    background: #fff9f5;
    border: 2px dashed #e4dad1;
    border-radius: 16px;
    padding: 18px 16px;
    margin-bottom: 10px;
    min-height: 60px;
    transition: all 0.2s;
    position: relative;
}

.pattern-row.drag-over {
    border-color: #7d7064;
    background: #f2ebe5;
}

.pattern-name {
    font-weight: 500;
    color: #7d7064;
    margin-bottom: 8px;
    font-size: 15px;
}

.pattern-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-tag {
    background: #ffffff;
    color: #7d7064;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    border: 1.5px solid #e4dad1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 100%;
}

.example-tag:hover {
    background: #e4dad1;
    color: #151515;
}

.example-meta-image {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    background: #e4dad1;
    flex-shrink: 0;
}

.example-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-icon {
    width: 18px;
    height: 18px;
    background: #e4dad1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7d7064;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.pattern-row:empty .pattern-name::after {
    content: " (Drop interactions here)";
    color: #b8a99a;
    font-weight: 400;
}

.search-box {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #e4dad1;
    border-radius: 100px;
    margin-bottom: 18px;
    font-size: 15px;
    background: #ffffff;
    color: #5f5f5f;
}

.search-box:focus {
    outline: none;
    border-color: #7d7064;
}

/* Comparison Specific Styles */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #F7E9DD;
    border-radius: 16px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: #151515;
}

.stat-label {
    font-size: 13px;
    color: #7d7064;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

.controls-section {
    /* background: #fff; */
    /* border: 1.5px solid #e4dad1; */
    border-radius: 16px;
    /* padding: 20px; */
    margin-bottom: 25px;
}

.filter-section {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

select {
    padding: 8px 16px;
    border: 1.5px solid #e4dad1;
    border-radius: 100px;
    font-size: 14px;
    background: #fff;
    color: #151515;
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: #7d7064;
}

.filter-section button {
    padding: 8px 16px;
    border: 1.5px solid #e4dad1;
    border-radius: 100px;
    font-size: 14px;
    background: #fff;
    color: #7d7064;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-section button:hover {
    background: #f2ebe5;
    border-color: #7d7064;
}

.archive-toggle {
    background: #f2ebe5;
    color: #000;
    margin-top: 32px;
    border: none;
    margin-bottom: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    transition: all 0.2s ease;
    
}

.archive-toggle:hover {
    background: #e4dad1;;
    transform: translateY(-1px);
}

.archive-toggle:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e4dad1;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #151515;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #7d7064;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f8f5f1;
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #151515;
}

.modal-body input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e4dad1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s ease;
}

.modal-body input:focus {
    outline: none;
    border-color: #7d7064;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e4dad1;
    justify-content: flex-end;
}

.modal-btn-secondary {
    background: #f8f5f1;
    color: #7d7064;
    border: 1.5px solid #e4dad1;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn-secondary:hover {
    background: #f0ede8;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #7d7064, #625750);
    color: #fff;
    border: 1.5px solid #7d7064;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #6a5d52, #504742);
    transform: translateY(-1px);
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1.5px solid #e4dad1;
    border-radius: 16px;
    overflow: hidden;
}

th, td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1.5px solid #ebe6e2;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

th {
    background-color: #dacabb;
    color: #151515;
    font-weight: 600;
    font-size: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-name {
    font-weight: 500;
    color: #151515;
    max-width: 200px;
}

.pattern-cell {
    font-size: 13px;
    max-width: 250px;
    word-wrap: break-word;
    color: #151515;
}

.pattern-cell em {
    color: #7d7064;
}


.difference-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 100px;
    font-weight: 400;
    font-size: 12px;
    background-color: transparent;
    /* border: 1.5px solid; */
}

.same { 
    background-color: #d4edda; 
    color: #155724; 
    border-color: #28a745;
}
.two-same { 
    background-color: #fff3cd; 
    color: #856404; 
    border-color: #ffc107;
}
.different { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #dc3545;
}

/* Neutral pill for difference analysis (grey background and text) */
.status-neutral {
    background-color: #dacabb; /* lighter brown from palette */
    color: #000000;
    border-color: #dacabb;
}


.final-decision-select {
    width: 100%;
    max-width: 180px;
    padding: 8px 12px;
    border: 1.5px solid #e4dad1;
    border-radius: 8px;
    font-size: 12px;
    background: #fff;
    color: #151515;
    font-family: inherit;
}

.final-decision-select:focus {
    outline: none;
    border-color: #7d7064;
}

tr:nth-child(even) {
    background-color: #faf7f5;
}

tr:hover {
    background-color: #f2ebe5;
}

tr:hover .interaction-link {
    opacity: 1 !important;
    background: #d4c7b8 !important;
}

.interaction-link:hover {
    opacity: 1 !important;
    background: #c5b8a9 !important;
    transform: scale(1.1);
}

.product-title-link {
    transition: text-decoration 0.2s ease;
}

.product-title-link:hover {
    text-decoration: underline !important;
}

.archive-section {
    margin-top: 32px;
}

.archive-content {
    display: none;
}

.archive-content.expanded {
    display: block;
}

/* Footer Styles */
.footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

.footer div {
    font-size: 11px;
    color: #999;
}

/* Sidebar Toggle for Mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    background: #fff;
    border-top: 1.5px solid #e4dad1;
    z-index: 101;
    justify-content: center;
    align-items: center;
    height: 48px;
    font-size: 18px;
    color: #7d7064;
    font-weight: 600;
    cursor: pointer;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 16px 0 rgba(0,0,0,0.04);
}

/* Mobile Responsive Styles */
@media (max-width: 800px) {
    /* Organizer mobile styles */
    body.organizer .container {
        flex-direction: column;
        height: auto;
    }

    body.organizer .header {
        flex-direction: column;
        gap: 24px;
    }

    body.organizer .main-content {
        padding: 20px 8px 80px 8px;
        border-radius: 0;
    }

    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 50vh;
        min-height: 220px;
        max-height: 50vh;
        background: #fff;
        border-left: none;
        border-top: 1.5px solid #e4dad1;
        z-index: 100;
        padding: 24px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateY(0);
    }

    .sidebar-stats {
        margin-top: 0;
        margin-bottom: 8px;
    }

    .interactions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sidebar-toggle {
        display: flex;
    }

    /* Comparison mobile styles */
    body.comparison .container {
        padding: 24px 16px;
    }

    body.comparison .header {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .stats {
        flex-direction: column;
        gap: 16px;
    }

    .controls-section {
        padding: 16px;
    }

    .filter-section {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .table-container {
        overflow-x: scroll;
    }

    table {
        min-width: 800px;
    }
}

@media (max-width: 600px) {
    body.organizer .main-content {
        padding: 24px;
        margin-bottom: 55vh;
    }

    .sidebar {
        min-height: 180px;
    }
}
