/* Variables */
:root {
    --primary-color: #4f46e5;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success-color: #10b981;
    --warn-color: #f59e0b;
    --error-color: #ef4444;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #f9fafb;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease-in-out;
    --container-padding: 1rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--container-padding);
        position: sticky;
        top: 0;
        z-index: 10;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
        flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
}

/* Main Content */
main {
    max-width: 1280px;
    width: 100%;
        margin: 1.5rem auto;
        padding: 0 var(--container-padding);
        box-sizing: border-box;
    }
    
    #workers-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
}

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
        gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    }
    
.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.filters {
    display: flex;
    gap: 0.5rem;
        flex-wrap: wrap;
}

select {
    padding: 0.625rem 2rem 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    outline: none;
        transition: var(--transition);
    appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.5rem center;
        background-size: 1rem;
}
    
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.refresh-button {
    padding: 0.625rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
}

.refresh-button:hover {
    background-color: #4338ca;
}

.refresh-button:active {
    transform: translateY(1px);
}
/* Workers Grid */
.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
        max-width: 100%;
}

/* Loading and Error States */
.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    color: var(--error-color);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    background-color: white;
    border-radius: 0.5rem;
    border: 2px dashed var(--border-color);
}

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

.modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    margin: 0 1rem;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
        margin: -0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
        align-items: center;
        justify-content: center;
}
    
.close-modal:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
        max-height: calc(90vh - 4rem);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 1px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
}

.tab-button {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
        min-height: 44px;
}

.tab-button:hover {
    color: var(--text-color);
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: theme('colors.primary.DEFAULT');
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Status Colors */
.status-running {
    color: var(--success-color);
}

.status-error {
    color: var(--error-color);
}

.status-warn {
    color: var(--warn-color);
}

.status-disabled {
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --container-padding: 0.75rem;
    }

    .workers-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-stats {
        justify-content: center;
    }

    .workers-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}
@media (max-width: 640px) {
    :root {
            --container-padding: 0.5rem;
        }
    
        html {
            font-size: 15px;
        }
    
        main {
            margin: 0.75rem auto;
            padding: 0;
        }
    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
            margin-bottom: 1rem;
            width: 100%;
            padding: 0 var(--container-padding);
        }
        
        .search-container {
            width: 100%;
    }

        .filters {
        width: 100%;
        justify-content: space-between;
    }

        select {
            flex: 1;
        min-width: 100px;
        }
        
        .refresh-button {
            width: 100%;
        }
        
        #workers-container {
            padding: 0 var(--container-padding);
            margin: 0;
    }

    .workers-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
            margin: 0.75rem 0;
            width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {

    .tab-button,
    .refresh-button,
    select,
    .close-modal {
        min-height: 44px;
        /* Apple recommended minimum touch target size */
    }
}
/* Custom styles for Poshmark Automation Dashboard */

/* Add any styles that can't be implemented with Tailwind utilities */

/* Active tab indicator */
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: theme('colors.primary.DEFAULT');
}

/* Custom spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Hide scrollbars for a cleaner UI in some containers */
.scrollbar-none {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

/* Utility class for 3px borders (not included in Tailwind by default) */
.border-l-3 {
    border-left-width: 3px;
}

.border-3 {
    border-width: 3px;
}