/**
 * Ad Restrictions Page Styles
 * Note: Common styles like .breadcrumbs, .btn-*, .badge, .table-container are in portal-common.css
 */

/* Container */
.restrictions-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

/* Page Header */
.restrictions-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.restrictions-header .header-content {
    flex: 1;
    min-width: 300px;
}

.restrictions-header .header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Entity Selector Section */
.entity-selector-section {
    background: var(--dark-bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.entity-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.entity-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--dark-bg-secondary);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary, #a0a0b0);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-size-small, 0.875rem);
    font-weight: 500;
}

.entity-tab:hover {
    background: var(--dark-bg-secondary);
    color: var(--text-primary, #ffffff);
}

.entity-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
}

.entity-tab .tab-icon {
    font-size: 1.125rem;
}

.entity-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.entity-dropdown-wrapper label {
    font-size: var(--font-size-small, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    white-space: nowrap;
}

.entity-select {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    padding: 12px 15px;
    background: var(--dark-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: var(--font-size-small, 0.875rem);
    cursor: pointer;
}

.entity-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Stats Section */
.restrictions-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

/* No Entity Message */
.no-entity-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--dark-bg-tertiary);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.no-entity-message .message-icon {
    font-size: var(--font-size-h1, 3rem);
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-entity-message h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 10px;
}

.no-entity-message p {
    font-size: var(--font-size-small, 0.875rem);
    color: var(--text-secondary, #a0a0b0);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Audit Log Section */
.audit-log-section {
    margin-top: 20px;
    text-align: right;
}

/* Category Badge */
/* An ad category is a classification, so it takes the neutral tag treatment rather than
   the brand cyan it used to sit in — that cyan is the progress status tone, and the row
   showing the category also shows whether the restriction is active. */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    font-size: var(--font-size-small, 0.875rem);
    color: var(--text-secondary);
}

.category-badge.with-subcategories::after {
    content: "+subs";
    font-size: 0.625rem;
    opacity: 0.7;
    margin-left: 4px;
}

/* Country Codes */
.country-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.country-code {
    display: inline-block;
    padding: 2px 6px;
    background: var(--info-bg, rgba(59, 130, 246, 0.15));
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--info-color, #3b82f6);
}

.country-code.global {
    background: var(--warning-bg, rgba(245, 158, 11, 0.15));
    color: var(--warning-color, #f59e0b);
}

/* Validity Status */
.validity-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.validity-dates {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

/* Reason Text */
.reason-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-small, 0.875rem);
    color: var(--text-secondary, #a0a0b0);
}

.reason-text:hover {
    white-space: normal;
    overflow: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .restrictions-header {
        flex-direction: column;
    }

    .entity-type-tabs {
        flex-direction: column;
    }

    .entity-tab {
        width: 100%;
        justify-content: center;
    }

    .entity-dropdown-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .entity-select {
        max-width: none;
    }

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