/* ============================================
   SHARED UTILITIES & BUTTONS
   ============================================ */
.tayit-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.tayit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
    line-height: 1.4;
    font-family: inherit;
}

.tayit-btn-primary,
.tayit-btn-accept, 
.tayit-btn-save,
.tayit-btn-accept-all {
    background: var(--tayit-primary-bg, #2271b1);
    color: var(--tayit-primary-text, #fff);
}
.tayit-btn-primary:hover,
.tayit-btn-accept:hover,
.tayit-btn-save:hover,
.tayit-btn-accept-all:hover {
    background: var(--tayit-primary-hover-bg, #135e96);
    opacity: 1;
}

.tayit-btn-outline,
.tayit-btn-settings,
.tayit-btn-necessary,
.tayit-btn-reject,
.tayit-btn-necessary-only,
.tayit-btn-reject-all {
    background: var(--tayit-secondary-bg, #fff);
    border: 1px solid transparent; /* Changed from fixed color to allow bg to shine */
    color: var(--tayit-secondary-text, #2c3e50);
}
.tayit-btn-outline:hover,
.tayit-btn-settings:hover,
.tayit-btn-necessary:hover,
.tayit-btn-reject:hover,
.tayit-btn-necessary-only:hover,
.tayit-btn-reject-all:hover {
    background: var(--tayit-secondary-hover-bg, #7f8c8d);
    opacity: 1;
    /* Removed hardcoded hover styles to respect user colors */
}

.tayit-btn-danger {
    background: #fff;
    border: 1px solid #d63638;
    color: #d63638;
}
.tayit-btn-danger:hover {
    background: #d63638;
    color: #fff;
}

/* ============================================
   COOKIE BANNER STYLES
   ============================================ */
.tayit-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--tayit-banner-bg, #fff);
    color: var(--tayit-banner-text, #3c434a);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: var(--tayit-font-size, 14px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.tayit-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tayit-banner-text {
    flex: 1 1 500px;
}

.tayit-banner-text h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: inherit;
}

.tayit-banner-text p {
    margin: 0 0 10px;
    font-size: 1em;
    line-height: 1.5;
    color: inherit;
}

.tayit-cookie-links {
    margin-top: 5px;
}

.tayit-cookie-banner .tayit-cookie-links a {
    color: var(--tayit-banner-link, #2271b1);
    text-decoration: underline;
    margin-right: 15px;
    font-size: 0.9em;
}
.tayit-cookie-banner .tayit-cookie-links a:hover {
    color: var(--tayit-banner-link-hover, #2271b1);
    text-decoration: none;
    opacity: 1;
}

.tayit-cookie-credit {
    font-size: 0.85em;
    margin-top: 10px;
    width: 100%;
    text-align: right;
}

.tayit-cookie-banner .tayit-cookie-credit a {
    color: var(--tayit-banner-link, #2271b1);
    text-decoration: none;
}

.tayit-cookie-banner .tayit-cookie-credit a:hover {
    color: var(--tayit-banner-link-hover, #2271b1);
    text-decoration: underline;
}

.tayit-cookie-footer-link {
    width: 100%;
    text-align: center;
    margin: 0;
    font-size: 0.85em;
}

.tayit-cookie-footer-link-anchor {
    color: var(--tayit-footer-link, var(--tayit-banner-link, #2271b1));
    text-decoration: underline;
}

.tayit-cookie-footer-link-anchor:hover {
    color: var(--tayit-footer-link-hover, var(--tayit-banner-link-hover, #2271b1));
    text-decoration: none;
}

.tayit-cookie-script-warning {
    position: fixed;
    top: 20px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 2147483646;
    width: min(600px, calc(100% - 40px));
    background: #ffffff;
    color: #b91c1c;
    font-size: var(--tayit-font-size, 14px);
    padding: 12px 16px;
    border: 2px solid #b91c1c;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

html.tayit-js .tayit-cookie-script-warning {
    display: none;
}

html.tayit-js .tayit-cookie-script-warning[data-force-show="1"] {
    display: block;
}

html.tayit-js .tayit-cookie-script-warning[data-force-hide="1"] {
    display: none;
}

.tayit-cookie-script-warning-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.tayit-cookie-script-warning-text {
    line-height: 1.35;
}

.tayit-cookie-script-warning-close {
    display: inline-block;
    border: 1px solid rgba(185,28,28,0.5);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tayit-cookie-script-warning-dismiss {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tayit-cookie-script-warning-dismiss:checked + .tayit-cookie-script-warning {
    display: none;
}

html.tayit-js .tayit-cookie-script-warning-dismiss:checked + .tayit-cookie-script-warning {
    display: none;
}

.tayit-banner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

/* Layout Variants */
.tayit-banner-top {
    bottom: auto;
    top: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.tayit-banner-floating-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    max-width: 600px;
    width: calc(100% - 40px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: 2px solid var(--tayit-primary-bg, #2271b1);
    text-align: center;
}

.tayit-banner-floating-center .tayit-banner-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tayit-banner-floating-center .tayit-banner-text {
    flex: auto;
    width: 100%;
    margin-bottom: 15px;
}

.tayit-banner-floating-center .tayit-banner-buttons {
    width: 100%;
    justify-content: center;
    gap: 15px;
}

.tayit-banner-floating-center .tayit-btn {
    min-width: 120px;
    justify-content: center;
}

.tayit-banner-floating-center .tayit-cookie-links {
    justify-content: center;
    margin-top: 15px;
}


/* ============================================
   SETTINGS MODAL STYLES
   ============================================ */
.tayit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    backdrop-filter: blur(2px);
}

.tayit-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--tayit-banner-bg, #fff);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 8px;
    z-index: 99999;
    border: 2px solid var(--tayit-banner-text, #3c434a);
    box-shadow: 0 0 0 2px var(--tayit-primary-bg, #2271b1), 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--tayit-banner-text, #3c434a);
}

.tayit-settings-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(127,127,127,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border-radius: 8px 8px 0 0;
}

.tayit-settings-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.tayit-settings-close {
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.tayit-settings-close:hover {
    color: #fff;
    background-color: var(--tayit-banner-link, #2271b1);
    opacity: 1;
}

.tayit-settings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tayit-settings-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.tayit-categories-list {
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.tayit-category-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.tayit-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tayit-category-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.tayit-category-desc {
    margin: 0;
    font-size: 0.9rem;
    color: inherit;
}

.tayit-required-note {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: #d63638;
    font-style: italic;
}

/* Toggle Switch */
.tayit-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.tayit-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tayit-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.tayit-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .tayit-slider {
    background-color: var(--tayit-primary-bg, #2271b1);
}

input:focus + .tayit-slider {
    box-shadow: 0 0 1px var(--tayit-primary-bg, #2271b1);
}

input:checked + .tayit-slider:before {
    transform: translateX(20px);
}

input:disabled + .tayit-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.tayit-settings-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(127,127,127,0.2);
    background: transparent;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 8px 8px;
}

/* ============================================
   PREFERENCE CENTER SHORTCODE STYLES
   ============================================ */

.tayit-preference-center-wrapper {
    max-width: 1000px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3e50;
}

.tayit-preference-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 2px solid #f0f0f1;
    padding-bottom: 20px;
}

.tayit-preference-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.tayit-last-updated {
    font-size: 0.9rem;
    color: #646970;
    background: #f6f7f7;
    padding: 5px 12px;
    border-radius: 20px;
}

.tayit-preference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* Card Styles */
.tayit-pref-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.tayit-pref-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.tayit-card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e2e4e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tayit-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.tayit-card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tayit-card-body p {
    margin: 0 0 20px;
    color: #50575e;
    line-height: 1.5;
}

/* Status Indicators */
.tayit-status-indicator {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
}

.status-pending { background: #fff8e5; border-left: 4px solid #f0b849; }
.status-accepted { background: #f0f9f2; border-left: 4px solid #00a32a; }
.status-essential { background: #e5f5fa; border-left: 4px solid #2271b1; }
.status-custom { background: #f6f7f7; border-left: 4px solid #646970; }

.tayit-status-icon {
    font-size: 1.5rem;
}

.tayit-status-text strong {
    display: block;
    color: #1d2327;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.tayit-status-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #50575e;
}

/* Badges */
.tayit-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    background: #2c3e50;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Shortcode Buttons Specifics */
.tayit-action-buttons,
.tayit-ccpa-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Make shortcode buttons full width */
.tayit-action-buttons .tayit-btn,
.tayit-ccpa-buttons .tayit-btn {
    width: 100%;
    box-sizing: border-box;
}

/* Dashicons in buttons */
.tayit-btn .dashicons {
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
}

/* Responsive */
@media (min-width: 768px) {
    .tayit-preference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
    /* Banner Layout */
    .tayit-banner-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tayit-banner-text {
        flex: auto;
        width: 100%;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .tayit-cookie-links {
        justify-content: center;
        display: flex;
        flex-wrap: wrap;
    }

    /* Banner Buttons - Stack vertically on mobile */
    .tayit-banner-buttons {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .tayit-banner-buttons .tayit-btn {
        width: 100%;
        justify-content: center;
        margin: 0; /* Let gap handle spacing */
    }
    
    /* CCPA Buttons in Banner - Mobile */
    .tayit-cookie-buttons-ccpa {
        width: 100%;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
    }
    
    .tayit-cookie-buttons-ccpa .tayit-btn {
        width: 100%;
    }
    
    /* Force floating banners to be full-width bottom bars on mobile */
    .tayit-banner-floating,
    .tayit-banner-floating-right {
        max-width: 100%;
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    }
    
    /* Settings Modal Full Screen on Mobile */
    .tayit-settings-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .tayit-settings-footer {
        flex-direction: column;
    }
    
    .tayit-settings-footer .tayit-btn {
        width: 100%;
    }
}
