/**
 * Icelandic Cookie Consent Banner Styles
 */

/* --- Banner Base --- */
.icc-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 10000; /* High z-index */
    background-color: #23282d; /* Default WP Admin dark */
    color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    display: none; /* Hidden by default, shown by JS */
    font-size: 14px;
    line-height: 1.5;
}

/* --- Layouts --- */
/* Box is default block/flex behavior */
.icc-layout-bar .icc-banner-content {
    /* Bar layout might need less padding or different flex settings if desired */
    /* Example: max-width: none; */
}

/* --- Positions --- */
.icc-position-bottom { /* Renamed from icc-banner-position-bottom */
    bottom: 0;
}

.icc-banner-position-top {
    top: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Center position for Banner (acts like a modal) */
.icc-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto; /* Override bottom */
    max-width: 600px; /* Limit width like a modal */
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
/* Ensure content centers within the centered banner */
.icc-position-center .icc-banner-content {
    flex-direction: column; /* Stack text and actions */
    align-items: flex-start;
}
.icc-position-center .icc-banner-actions {
     width: 100%;
     justify-content: flex-end; /* Align buttons right */
     margin-top: 15px;
}


.icc-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px; /* Limit width on large screens */
    margin: 0 auto;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Space between text and actions */
}

.icc-banner-text {
    flex-grow: 1; /* Take available space */
    margin-right: 20px; /* Space before buttons */
}

.icc-banner-text a,
.icc-banner-text .icc-settings-link {
    color: #ffffff; /* Default link color */
    text-decoration: underline;
    margin-left: 10px; /* Space before settings link */
    cursor: pointer;
}
.icc-banner-text .icc-settings-link:hover {
    text-decoration: none;
}
.icc-banner-text .icc-settings-link:focus-visible {
    outline: 2px solid #ffffff; /* White outline for contrast on dark bg */
    outline-offset: 2px;
    background-color: rgba(255, 255, 255, 0.1); /* Slight background highlight */
}


.icc-banner-actions {
    display: flex;
    gap: 10px; /* Space between buttons */
    flex-shrink: 0; /* Prevent buttons from shrinking too much */
}

/* Button Options */
.icc-buttons-flipped .icc-banner-actions,
.icc-modal.icc-buttons-flipped .icc-modal-actions {
    flex-direction: row-reverse; /* Flip button order */
}
/* Ensure spacing is correct when flipped */
.icc-buttons-flipped .icc-banner-actions button:first-child {
    margin-left: 0;
    margin-right: 10px; /* Adjust gap side */
}
.icc-modal.icc-buttons-flipped .icc-modal-actions button:first-child {
     margin-left: 0;
     margin-right: 10px; /* Adjust gap side */
}


.icc-buttons-equal .icc-banner-actions .icc-btn,
.icc-modal.icc-buttons-equal .icc-modal-actions .icc-btn {
    flex-grow: 1; /* Make buttons share space equally */
    text-align: center;
}


/* --- Buttons --- */
.icc-btn {
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out, filter 0.15s ease-in-out, outline 0.15s ease-in-out;
}
.icc-btn:focus-visible { /* Use focus-visible for better accessibility */
    outline: 2px solid #007cba; /* WP Blue outline */
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba; /* Enhanced visibility */
}

.icc-btn-primary {
    background-color: #007cba; /* Default WP blue */
    border-color: #007cba;
    color: #ffffff;
}
.icc-btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #ffffff;
    filter: brightness(95%); /* Slight darken */
}

.icc-btn-secondary {
    background-color: #6c757d; /* Default gray */
    border-color: #6c757d;
    color: #ffffff;
}
.icc-btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    color: #ffffff;
}

/* --- UI Blocking Overlay --- */
.icc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 9999; /* Below banner, above content */
    display: none; /* Hidden by default */
}
.icc-overlay.icc-is-visible {
    display: block;
}

/* --- Re-consent Trigger --- */
.icc-reconsent-trigger {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background-color: #f0f0f1; /* Light gray */
    color: #1d2327; /* Dark gray text */
    padding: 8px;
    border-radius: 50%; /* Make it circular */
    cursor: pointer;
    z-index: 9998; /* Below overlay/banner */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    font-size: 18px; /* Adjust icon size */
    line-height: 1;
    width: 36px; /* Ensure circle */
    height: 36px; /* Ensure circle */
    text-align: center;
}
.icc-reconsent-trigger:hover {
    background-color: #e0e0e1;
}
.icc-reconsent-trigger:focus-visible {
    outline: 2px solid #007cba; /* WP Blue outline */
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba; /* Enhanced visibility */
}

/* --- Customize Modal --- */
.icc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay for modal */
    z-index: 10001; /* Above banner */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if content overflows */
}

.icc-modal.icc-is-visible {
    display: flex !important; /* Use flex to center content by default - Added !important for testing */
}

/* Preferences Modal Positions */
.icc-modal.icc-prefs-position-left {
    justify-content: flex-start;
    align-items: stretch; /* Full height */
    padding: 0; /* Remove padding for side modal */
}
.icc-modal.icc-prefs-position-left .icc-modal-content {
    height: 100%;
    border-radius: 0;
    max-width: 400px; /* Adjust width for side modal */
    max-height: 100%;
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
}

.icc-modal.icc-prefs-position-right {
    justify-content: flex-end;
    align-items: stretch; /* Full height */
    padding: 0; /* Remove padding for side modal */
}
.icc-modal.icc-prefs-position-right .icc-modal-content {
    height: 100%;
    border-radius: 0;
    max-width: 400px; /* Adjust width for side modal */
    max-height: 100%;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}


.icc-modal-content {
    background-color: #ffffff;
    color: #1d2327; /* Dark text */
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 600px; /* Limit modal width */
    width: 100%;
    position: relative; /* For close button positioning */
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Scroll inside content if needed */
}

.icc-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 5px;
}
.icc-modal-close:hover {
    color: #000;
}
.icc-modal-close:focus-visible {
    outline: 2px solid #007cba; /* WP Blue outline */
    outline-offset: 1px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba; /* Enhanced visibility */
}

.icc-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #1d2327;
}

#icc-customize-form p {
    margin-bottom: 15px;
}

.icc-category {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e1; /* Separator */
}
.icc-category:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.icc-category label {
    display: flex; /* Align checkbox and text */
    align-items: center;
    margin-bottom: 5px;
    cursor: pointer;
}

.icc-category input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    vertical-align: middle; /* Align better with label text */
}
.icc-category input[type="checkbox"]:focus-visible {
    outline: 2px solid #007cba; /* WP Blue outline */
    outline-offset: 1px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba; /* Enhanced visibility */
}
.icc-category input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.icc-category strong {
    font-weight: 600;
}

.icc-category-description {
    font-size: 13px;
    color: #555;
    margin-left: 26px; /* Indent description under label text */
    margin-top: 0;
    margin-bottom: 0;
}

.icc-modal-actions {
    margin-top: 25px;
    text-align: right; /* Align button to the right */
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .icc-banner-content {
        flex-direction: column; /* Stack text and actions */
        align-items: flex-start; /* Align items to the start */
    }
    .icc-banner-text {
        margin-right: 0;
        margin-bottom: 10px; /* Space below text when stacked */
    }
    .icc-banner-actions {
        width: 100%; /* Make buttons take full width */
        justify-content: flex-end; /* Align buttons right */
    }
    .icc-modal-content {
        padding: 20px;
    }
    .icc-modal h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .icc-banner-actions {
        flex-direction: column; /* Stack buttons vertically */
        align-items: stretch; /* Make buttons full width */
    }
    .icc-btn {
        width: 100%;
        text-align: center;
    }
}
