/* Consents Page Styles */

/* Legacy compatibility variables */
:root {
    --background: var(--surface-primary);
    --foreground: var(--content-primary);
    --card: var(--surface-primary);
    --card-foreground: var(--content-primary);
    --primary: var(--action-primary);
    --primary-foreground: var(--content-inverse);
    --secondary: var(--surface-secondary);
    --secondary-foreground: var(--content-primary);
    --muted: var(--surface-secondary);
    --muted-foreground: var(--content-secondary);
    --accent: var(--surface-secondary);
    --accent-foreground: var(--content-primary);
    --destructive: var(--action-destructive);
    --destructive-foreground: var(--content-inverse);
    --border: var(--border-primary);
    --input: var(--border-primary);
    --ring: var(--action-primary);
    --radius: 0.5rem;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: hsl(var(--card));
    border-right: 1px solid hsl(var(--border));
    padding: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    color: hsl(var(--slate-500));
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-nav-link:hover {
    background: hsl(var(--slate-100));
    color: hsl(var(--slate-700));
}

.sidebar-nav-link.active {
    background: hsl(var(--slate-700));
    color: hsl(var(--slate-50));
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.content-subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Data Table Container */
.table-container {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Filter Styles */
.table-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: hsl(var(--slate-50));
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--slate-200));
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row-primary {
    justify-content: flex-start;
}

.filter-row-secondary {
    justify-content: space-between;
    align-items: center;
}

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

.filter-group-search {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.filter-group-date {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

.filter-input, .filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: inherit;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.filter-select {
    cursor: pointer;
    min-width: 140px;
}

.filter-clear-btn {
    padding: 0.5rem 1rem;
    background: hsl(var(--slate-200));
    color: hsl(var(--slate-700));
    border: 1px solid hsl(var(--slate-300));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-clear-btn:hover {
    background: hsl(var(--slate-300));
    border-color: hsl(var(--slate-400));
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    .filter-row-primary {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group-search {
        order: -1;
    }

    .filter-group-search .filter-input {
        width: 100%;
    }

    .filter-select {
        min-width: 120px;
    }

    .filter-row-secondary {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group-date {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .filter-group-date input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .table-filters {
        padding: 1rem;
        margin: 1rem;
    }

    .filter-row-primary,
    .filter-row-secondary {
        gap: 0.75rem;
    }

    .filter-group {
        min-width: auto;
    }

    .filter-input,
    .filter-select,
    .filter-clear-btn {
        font-size: 16px;
        padding: 0.75rem;
    }
}

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

.data-table thead {
    background: hsl(var(--muted));
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    border-bottom: 1px solid hsl(var(--border));
}

.data-table tbody tr {
    border-bottom: 1px solid hsl(var(--border));
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: hsl(var(--accent));
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

/* Consent Type Badge */
.consent-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.consent-item {
    margin-bottom: 0.25rem;
}

.consent-date {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}

.consent-status {
    margin-bottom: 0.25rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.active {
    background: hsl(var(--slate-100));
    color: hsl(142 45% 36%);
    border: 1px solid hsl(142 45% 36% / 0.3);
}

.status-badge.rejected {
    background: hsl(var(--slate-100));
    color: hsl(0 60% 50%);
    border: 1px solid hsl(0 60% 50% / 0.3);
}

.status-badge.pending {
    background: hsl(var(--slate-100));
    color: hsl(38 70% 45%);
    border: 1px solid hsl(38 70% 45% / 0.3);
}

.consent-badge.marketing {
    background: hsl(var(--slate-200));
    color: hsl(var(--slate-700));
    border: 1px solid hsl(var(--slate-300));
}

.consent-badge.terms {
    background: hsl(var(--slate-100));
    color: hsl(var(--slate-800));
    border: 1px solid hsl(var(--slate-200));
}

.consent-badge.privacy {
    background: hsl(var(--slate-300) / 0.3);
    color: hsl(var(--slate-900));
    border: 1px solid hsl(var(--slate-300));
}

.consent-badge.newsletter {
    background: hsl(var(--slate-200) / 0.7);
    color: hsl(var(--slate-700));
    border: 1px solid hsl(var(--slate-300) / 0.7);
}

/* Content Preview */
.content-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: hsl(var(--muted-foreground));
}

.content-preview:hover {
    cursor: pointer;
    color: hsl(var(--foreground));
}

/* Notes Cell */
.notes-cell {
    max-width: 200px;
}

.consent-note {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 1.25rem;
}

.notes-text {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Consent Actions Container */
.consent-actions {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 0.25rem;
    align-items: center;
}

/* Action Buttons */
.action-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.accept-btn {
    background: hsl(var(--slate-100));
    color: hsl(142 45% 36%);
    border-color: hsl(142 45% 36% / 0.2);
}

.accept-btn:hover:not(.disabled) {
    background: hsl(142 45% 36% / 0.1);
    border-color: hsl(142 45% 36% / 0.4);
}

.reject-btn {
    background: hsl(var(--slate-100));
    color: hsl(0 60% 45%);
    border-color: hsl(0 60% 45% / 0.2);
}

.reject-btn:hover:not(.disabled) {
    background: hsl(0 60% 45% / 0.1);
    border-color: hsl(0 60% 45% / 0.4);
}

.details-btn {
    background: hsl(var(--slate-100));
    color: hsl(var(--slate-600));
    border-color: hsl(var(--slate-300));
}

.details-btn:hover {
    background: hsl(var(--slate-200));
    border-color: hsl(var(--slate-400));
}

.action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: hsl(var(--slate-50));
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: hsl(var(--slate-900));
    color: hsl(var(--slate-50));
    text-align: center;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: hsl(var(--slate-900)) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Alternative: use CSS-only tooltip with data attributes */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(var(--slate-900));
    color: hsl(var(--slate-50));
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
}

[data-tooltip]:hover:after {
    content: "";
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: hsl(var(--slate-900)) transparent transparent transparent;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
}

/* Legacy button styles for compatibility */
.view-details-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    background: hsl(var(--slate-700));
    color: hsl(var(--slate-50));
}

.view-details-btn:hover {
    background: hsl(var(--slate-800));
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: hsl(var(--card));
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: hsl(var(--foreground));
}

.modal-body {
    color: hsl(var(--foreground));
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

.form-select, .form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: inherit;
}

.form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.form-textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-secondary, .btn-danger {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary {
    background: hsl(var(--slate-200));
    color: hsl(var(--slate-700));
    border: 1px solid hsl(var(--slate-300));
}

.btn-danger {
    background: hsl(0 60% 50%);
    color: white;
}

.btn-secondary:hover {
    background: hsl(var(--slate-300));
}

.btn-danger:hover {
    background: hsl(0 60% 45%);
}

/* Pagination Styles */
.pagination-container {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.pagination-info {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

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

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: hsl(var(--slate-100));
    border-color: hsl(var(--slate-300));
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    color: hsl(var(--slate-700));
    cursor: pointer;
    transition: all 0.2s;
    min-width: 2.5rem;
    text-align: center;
}

.page-number:hover {
    background: hsl(var(--slate-100));
    border-color: hsl(var(--slate-300));
}

.page-number.active {
    background: hsl(var(--slate-700));
    color: hsl(var(--slate-50));
    border-color: hsl(var(--slate-700));
}

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

.pagination-size label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.page-size-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    cursor: pointer;
}

.page-size-select:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

/* Back to Dashboard Button */
.back-dashboard {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: hsl(var(--foreground));
    text-decoration: none;
}

.back-dashboard:hover {
    background: hsl(var(--slate-100));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    color: hsl(var(--primary));
}

@media (max-width: 768px) {
    .back-dashboard {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}
