/* static/css/marketer-dashboard.css */
/* Marketer Dashboard Styles - Dark Theme matching app gallery */

/* Main Container */
.marketer-dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #111827;
    color: #f3f4f6;
}

#sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    color: white;
}

.user-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.user-details-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-details-group p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Tab Navigation */
.tab-navigation {
    background: #1f2937;
    border-bottom: 1px solid #374151;
}

.tab-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    padding: 0 20px;
}

.tab-navigation li {
    margin: 0;
}

.tab-navigation a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #9ca3af;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-navigation a:hover {
    color: #a855f7;
}

.tab-navigation a.active {
    color: #a855f7;
    border-bottom-color: #a855f7;
}

/* Admin Selector Bar */
.admin-selector-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #1f2937;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #374151;
}

.admin-selector-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #f3f4f6;
}

.admin-selector-bar label i {
    color: #a855f7;
}

.marketer-dropdown {
    padding: 8px 12px;
    border: 1px solid #374151;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 200px;
    background: #111827;
    color: #f3f4f6;
}

/* Business Header */
.business-header {
    margin-bottom: 20px;
}

.business-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #f3f4f6;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 20px 0;
}

/* Dashboard Footer */
.dashboard-footer {
    padding: 20px;
    text-align: center;
    background: #1f2937;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.9rem;
}

.dashboard-footer p {
    margin: 0;
}

.marketer-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #f3f4f6;
}

.business-name {
    font-size: 1rem;
    color: #9ca3af;
}

.admin-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-selector label {
    font-weight: 500;
    color: #9ca3af;
}

/* Loading and Error States */
.loading-container,
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #f3f4f6;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #374151;
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    color: #f87171;
    margin-bottom: 15px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #1f2937;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #374151;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
}

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    font-size: 1.5rem;
    color: #a855f7;
}

.card-content {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f3f4f6;
}

.card-label {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Dashboard Sections */
.dashboard-section {
    background: #1f2937;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: #f3f4f6;
    border-bottom: none;
}

.section-title i {
    color: #a855f7;
}

.badge {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.half-width {
    margin-bottom: 0;
}

/* Top Garments Grid */
.top-garments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.top-garment-card {
    background: #111827;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid #374151;
}

.top-garment-card:hover {
    transform: scale(1.02);
    border-color: #a855f7;
}

.garment-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 1;
}

.garment-image-container {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #374151;
}

.garment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 2rem;
}

.garment-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.garment-name {
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.garment-category {
    font-size: 0.85rem;
    color: #9ca3af;
}

.garment-tryons {
    font-size: 0.9rem;
    color: #a855f7;
    font-weight: 500;
}

/* Category Stats */
.category-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.category-name {
    font-weight: 500;
    color: #f3f4f6;
}

.category-count {
    color: #9ca3af;
}

.category-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
}

.category-bar {
    height: 8px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-percentage {
    font-size: 0.85rem;
    color: #9ca3af;
    min-width: 40px;
}

/* Date Stats */
.date-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #111827;
    border-radius: 8px;
    border: 1px solid #374151;
}

.date-label {
    font-weight: 500;
    color: #f3f4f6;
}

.date-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #a855f7;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #374151;
    color: #f3f4f6;
}

.data-table th {
    background: #111827;
    font-weight: 600;
    color: #f3f4f6;
}

.data-table tr:hover {
    background: rgba(168, 85, 247, 0.1);
}

.image-cell {
    width: 60px;
}

.table-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.no-image-small {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    border-radius: 6px;
    color: #6b7280;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-pending_approval {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-style: italic;
}

/* Buttons */
.button {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.primary-button {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    color: white;
}

.primary-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Links in tables */
.data-table a {
    color: #a855f7;
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .marketer-dashboard {
        padding: 15px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-selector {
        width: 100%;
    }

    .marketer-dropdown {
        flex: 1;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .top-garments-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .top-garments-grid {
        grid-template-columns: 1fr;
    }
}

/* Share Message Section */
.share-message-container {
    padding: 10px 0;
}

.section-description {
    color: #9ca3af;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.share-message-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.share-message-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-message-form label {
    font-weight: 500;
    color: #e5e7eb;
}

.share-message-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    color: #f3f4f6;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.share-message-form textarea:focus {
    outline: none;
    border-color: #a855f7;
}

.share-message-form textarea::placeholder {
    color: #6b7280;
}

.char-count {
    text-align: left;
    font-size: 0.85rem;
    color: #6b7280;
}

.share-message-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-message-actions .button {
    padding: 10px 20px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.share-message-actions .secondary-button {
    background: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
}

.share-message-actions .secondary-button:hover:not(:disabled) {
    border-color: #6b7280;
    color: #e5e7eb;
}

.share-message-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.share-message-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #1f2937;
    border-radius: 8px;
    border: 1px solid #374151;
    font-size: 0.9rem;
    color: #9ca3af;
}

.share-message-hint i {
    color: #fbbf24;
    margin-top: 2px;
}

.share-message-hint em {
    color: #a855f7;
    font-style: normal;
}

#share-message-status {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

#share-message-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

#share-message-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}
