/*
Theme Name: Softways Child
Template: softways
Description: Softways Child Theme
Author: Your Name
Version: 1.0.0
*/

/* --- General Body & HTML cleanup (optional, but good practice) --- */
body {
    margin: 0;
    padding: 0;
}

/* --- Consent Banner at the bottom --- */
#wp-consent-mode-v2-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly darker overlay for banner */
    color: white;
    padding: 20px;
    z-index: 999990;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px; /* Space between text and buttons */
    box-sizing: border-box; /* Include padding in width */
    transition: transform 0.3s ease-out; /* Smooth slide in/out */
}

#wp-consent-mode-v2-banner.wp-consent-banner-closed {
    transform: translateY(100%); /* Slide out of view */
    pointer-events: none; /* Disable interactions when hidden */
}

#wp-consent-mode-v2-banner.wp-consent-banner-open {
    transform: translateY(0); /* Slide into view */
    pointer-events: auto; /* Enable interactions */
}

#wp-consent-mode-v2-banner .banner-content {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#wp-consent-mode-v2-banner .banner-text {
    flex-grow: 1;
    margin-right: 20px; /* Space before buttons on larger screens */
}

#wp-consent-mode-v2-banner h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
    color: white; /* Ensure heading is white */
}

#wp-consent-mode-v2-banner p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
}

#wp-consent-mode-v2-banner .banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    justify-content: center; /* Center buttons on smaller screens */
}

#wp-consent-mode-v2-banner button {
    background-color: #0073aa;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap; /* Prevent button text from breaking */
}

#wp-consent-mode-v2-banner button:hover {
    background-color: #005177;
    transform: translateY(-1px);
}

/* Specific button styles */
#wp-consent-mode-v2-accept-all {
    background-color: #4CAF50; /* Green for accept */
}

#wp-consent-mode-v2-accept-all:hover {
    background-color: #45a049;
}

#wp-consent-mode-v2-deny-all {
    background-color: #f44336; /* Red for deny */
}

#wp-consent-mode-v2-deny-all:hover {
    background-color: #da190b;
}

#wp-consent-mode-v2-manage-preferences {
    background-color: #008CBA; /* Blue for manage */
}

#wp-consent-mode-v2-manage-preferences:hover {
    background-color: #007ba7;
}

/* --- Overlay for Modal --- */
#wp-consent-mode-v2-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999; /* Higher z-index than banner */
    opacity: 0; /* Initially transparent */
    visibility: hidden; /* Initially hidden from screen readers/interaction */
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out; /* Smooth fade */
}

#wp-consent-mode-v2-overlay.active {
    opacity: 1; /* Fade in */
    visibility: visible; /* Make visible */
    pointer-events: auto; /* Allow clicks on overlay */
}

/* --- Preferences Modal --- */
#wp-consent-mode-v2-preferences {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000000; /* Even higher z-index than overlay */
    max-width: 600px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    opacity: 0; /* Initially transparent */
    visibility: hidden; /* Initially hidden from screen readers/interaction */
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out; /* Smooth fade */
}

#wp-consent-mode-v2-preferences.active {
    opacity: 1; /* Fade in */
    visibility: visible; /* Make visible */
}

#wp-consent-mode-v2-preferences h4#wp-consent-mode-v2-modal-heading,
#wp-consent-mode-v2-preferences h2 { /* Targeting both h4 and h2 to be safe */
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

#wp-consent-mode-v2-preferences p#wp-consent-mode-v2-modal-description,
#wp-consent-mode-v2-preferences p.modal-description { /* Targeting both p elements */
    margin-bottom: 25px;
    line-height: 1.6;
    color: #555;
}

.consent-options {
    margin-bottom: 25px;
}

.consent-option-group {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    display: block; /* Ensure groups take full width and stack properly */
    width: 100%;
    margin-bottom: 15px; /* Add space between groups */
}

.consent-option-group:last-child {
    border-bottom: none;
}

.consent-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribute items */
    margin-bottom: 5px; /* Space before description */
    width: 100%; /* Ensure it uses full width */
}

.consent-option-item label.toggle-switch {
    position: relative;
    display: flex; /* Make the label itself a flex container to align its internal elements */
    align-items: center;
    flex-shrink: 0; /* Prevent switch from shrinking */
    flex-grow: 0; /* Prevent the switch from growing unexpectedly */
    /* margin-right: 10px; Removed, as toggle-label will have new margin-left */
}

.consent-option-item label.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.consent-option-item .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 25px; /* Make it round */
    width: 45px; /* Explicit width for slider to define switch size */
    height: 25px; /* Explicit height for slider to define switch size */
}

.consent-option-item .slider:before {
    position: absolute;
    content: "";
    height: 17px; /* Adjust slider height */
    width: 17px; /* Adjust slider width */
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%; /* Make it round */
}

/* Green background when checkbox is CHECKED */
.consent-option-item input:checked + .slider {
    background-color: #4CAF50 !important; /* Your desired green color. Using !important to force it. */
}

.consent-option-item input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

.consent-option-item input:checked + .slider:before {
    transform: translateX(20px); /* Adjust based on switch width */
}

/* Disabled state */
.consent-option-item input:disabled + .slider {
    background-color: #a0a0a0; /* Dim background for disabled */
    cursor: not-allowed;
}

.consent-option-item input:disabled + .slider:before {
    background-color: #f0f0f0; /* Dim handle for disabled */
}

.consent-option-item .toggle-label {
    /* --- CRITICAL FIXES FOR LABEL WIDTH --- */
    margin-left: 45px; /* Increased space from the switch as you suggested */
    flex-grow: 1; /* Allow label to take available space */
    white-space: normal; /* Allow text to wrap if it's long */
    min-width: 0; /* Important for flex items to shrink if necessary */
    max-width: 100%; /* Ensure it takes all available width within its container as you suggested */
    /* --- END CRITICAL FIXES --- */

    font-weight: bold;
    color: #333;
}

.consent-option-item .info-text {
    font-size: 0.85em;
    color: #888;
    margin-left: 10px;
    white-space: nowrap; /* Prevent text from wrapping prematurely */
    flex-shrink: 0; /* Prevent the info-text from shrinking */
}

.consent-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    margin-left: 60px; /* Indent description to align with label text */
    clear: both; /* In case any elements above are floated */
    padding-left: 5px; /* Align with the options if they have padding */
}

.preferences-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.preferences-buttons button {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.preferences-buttons button:hover {
    background-color: #005177;
    transform: translateY(-1px);
}

.preferences-buttons #wp-consent-mode-v2-save-preferences {
    background-color: #4CAF50; /* Green save button */
    color: white;
    border: none;
}

.preferences-buttons #wp-consent-mode-v2-close-preferences {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

/* --- Revisit Consent Button - Elegant Circle with Icon --- */
#wp-consent-mode-v2-revisit {
    position: fixed;
    bottom: 30px; /* Increased distance from bottom */
    right: 30px;  /* Increased distance from right */
    z-index: 999998; /* Ensure it's on top */
    opacity: 0.8; /* Subtle transparency */
    transition: all 0.3s ease-in-out; /* Smooth transitions */
    transform: scale(1); /* Initial scale */
}

#wp-consent-mode-v2-revisit:hover {
    opacity: 1; /* Fully opaque on hover */
    transform: scale(1.05); /* Slightly larger on hover */
}

#wp-consent-mode-v2-revisit button {
    background-color: #333; /* Dark background */
    color: #fff;            /* White text for icon */
    border: none;
    border-radius: 50%;     /* MAKE IT A CIRCLE! */
    width: 50px;           /* Fixed width for the circle */
    height: 50px;          /* Fixed height for the circle */
    display: flex;         /* Use flexbox for icon centering */
    align-items: center;   /* Center icon vertically */
    justify-content: center; /* Center icon horizontally */
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* More prominent shadow */
    overflow: hidden; /* Hide any overflowing text */
    text-indent: 100%; /* Push text out of view */
    white-space: nowrap; /* Prevent text wrap */
    position: relative; /* For pseudo-element positioning */
}

#wp-consent-mode-v2-revisit button::before {
    /* Font Awesome Icon (e.g., gear/cog) */
    /* This assumes Font Awesome is loaded on your site. If not,
       you will only see a square or need to use a unicode char. */
    font-family: 'Font Awesome 5 Free'; /* Or 'Font Awesome 6 Free', check your version */
    font-weight: 900; /* Font Awesome solid icon weight */
    content: '\f013'; /* Unicode for the gear/cog icon */
    font-size: 24px; /* Size of the icon */
    color: #fff; /* Icon color */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfectly center the icon */
    text-indent: 0; /* Bring icon text back into view */
}

/* Fallback for icon if Font Awesome is not loaded */
#wp-consent-mode-v2-revisit button:not([class*="fa"])::before {
    content: '\2699'; /* Unicode for a gear/cog symbol if FA not found */
    font-family: sans-serif; /* Use a generic font for unicode */
    font-size: 24px;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #wp-consent-mode-v2-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    #wp-consent-mode-v2-banner .banner-text {
        margin-right: 0;
        margin-bottom: 15px;
    }

    #wp-consent-mode-v2-banner .banner-buttons {
        width: 100%;
        justify-content: center;
    }

    #wp-consent-mode-v2-preferences {
        width: 95%;
        padding: 20px;
    }

    .preferences-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    #wp-consent-mode-v2-revisit {
        bottom: 20px; /* Slightly smaller margin on mobile */
        right: 20px;
    }
    #wp-consent-mode-v2-revisit button {
        width: 45px; /* Slightly smaller circle on mobile */
        height: 45px;
        font-size: 20px; /* Adjust icon size for mobile */
    }
}