/* Cookie Banner Base Styles */
.ig-cm-cookie-info-container * {
    box-sizing: border-box;
}

.ig-cm-cookie-info-container {
    z-index: 9999;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #e5e7eb;
    padding: 20px 30px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: slideUp 0.3s ease-out;
    border-radius: 12px 12px 0 0;
    box-sizing: border-box;
}

/* Hide banner */
.ig-cm-cookie-info-container.ig-cm-hidden {
    display: none;
}

/* Message styling */
.ig-cm-cookie-info {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding-right: 10px;
}

.ig-cm-cookie-info a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: underline;
}

.ig-cm-cookie-info a:hover {
    color: #1e40af;
}

/* Button group */
.ig-cm-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    flex: 0 0 auto;
}

/* Buttons */
button.ig-cm-cookie-accept-button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    white-space: nowrap;
    box-sizing: border-box;
}

button.ig-cm-cookie-accept-button:hover {
    background-color: #1e40af;
}
 
/* Focus state */
button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Animation */
@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .ig-cm-cookie-info-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 24px;
    }

    .ig-cm-cookie-info {
        font-size: 14px;
        padding-right: 0;
    }

    .ig-cm-buttons {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .ig-cm-cookie-info-container {
        padding: 16px 20px;
    }

    .ig-cm-cookie-info {
        font-size: 13px;
    }

    .ig-cm-buttons {
        flex-direction: column;
        gap: 8px;
    }

    button.ig-cm-cookie-accept-button,
    button.ig-cm-cookie-reject-button,
    button.ig-cm-cookie-customize-button {
        width: 100%;
    }
}

/* Customize Button */ 
button.ig-cm-cookie-customize-button {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151; 
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

button.ig-cm-cookie-customize-button:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

/* Backdrop Overlay with Blur */
.ig-cm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.ig-cm-backdrop.ig-cm-hidden {
    display: none !important;
}

button.ig-cm-cookie-reject-button {
    background-color: #f3f4f6;
    color: #374151;
    box-shadow: none;
    border: none;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

button.ig-cm-cookie-reject-button:hover {
    background-color: #e5e7eb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Compact Popup (bottom right corner) */
.ig-cm-customize-popup {
    position: fixed;
    z-index: 10001;
    display: block;
    bottom: 20px;
    right: 20px;
    transform: none;
    animation: popupSlideIn 0.3s ease-out;
}

.ig-cm-customize-popup.ig-cm-hidden {
    display: none !important;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Customization Dialog (Compact) */
.ig-cm-customize-dialog {
    background: white;
    border-radius: 16px;
    padding: 1px 0px;
    width: 400px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Dialog Header */
.ig-cm-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 10px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ig-cm-dialog-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}
 
/* Close Button */
.ig-cm-close-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ig-cm-close-btn:hover {
    background-color: #f3f4f6;
    color: #4b5563;
}

.ig-cm-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Cookie Categories */
.ig-cm-cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.ig-cm-cookie-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ig-cm-category-info {
    flex: 1;
}

.ig-cm-category-label {
    font-size: 16px;
    color: #111827;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.ig-cm-category-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.ig-cm-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.ig-cm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ig-cm-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 28px;
}

.ig-cm-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ig-cm-toggle input:checked + .ig-cm-toggle-slider {
    background-color: #2563eb;
}

.ig-cm-toggle input:checked + .ig-cm-toggle-slider:before {
    transform: translateX(24px);
}
  
/* Disabled toggle (necessary cookies) */
.ig-cm-toggle-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ig-cm-toggle-disabled input:checked + .ig-cm-toggle-slider {
    background-color: #93c5fd;
}
 
/* Popup Button Group */
.ig-cm-popup-button-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 0 24px;
    width: calc(100% - 48px);
}

/* Accept All Button in Popup */
.ig-cm-popup-accept-all {
    flex: 1;
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-cm-popup-accept-all:hover {
    background-color: #1e40af;
}

/* Reject All Button in Popup */
.ig-cm-popup-reject-all {
    flex: 1;
    background-color: #f3f4f6;
    color: #374151;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-cm-popup-reject-all:hover {
    background-color: #e5e7eb;
}

/* Save Preferences Button */
.ig-cm-save-preferences {
    width: calc(100% - 48px);
    margin: 16px 24px;
    background-color: #1f2937;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-cm-save-preferences:hover {
    background-color: #111827;
}

/* Powered By Footer */
.ig-cm-powered-by {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    letter-spacing: 0.5px;
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
}

/* Cookie Settings Button (Fixed position, appears after consent) */
.ig-cm-cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
}

.ig-cm-cookie-settings-btn:hover {
    background-color: #1e40af;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
    transform: scale(1.05);
}

.ig-cm-cookie-settings-btn.ig-cm-hidden {
    display: none;
}

.ig-cm-cookie-settings-btn svg {
    width: 24px;
    height: 24px;
}
.ig-cm-cookie-settings-btn svg:first-child {
    display: none;
}


/* Responsive for dialog */
@media (max-width: 600px) {
    .ig-cm-customize-dialog {
        width: calc(100vw - 30px);
    }
    
    .ig-cm-dialog-header {
        padding: 20px 20px 16px 20px;
    }
    
    .ig-cm-dialog-title {
        font-size: 18px;
    }
     
    .ig-cm-cookie-categories {
        padding: 20px;
        gap: 18px;
    }
    
    .ig-cm-category-label {
        font-size: 15px;
    }
    
    .ig-cm-category-description {
        font-size: 13px;
    }
    
    /* Stack popup buttons vertically on mobile */
    .ig-cm-popup-button-group {
        flex-direction: column;
        width: calc(100% - 40px);
        padding: 0 20px;
    }
    
    .ig-cm-save-preferences {
        width: calc(100% - 40px);
        margin: 16px 20px;
    }
    
    .ig-cm-powered-by {
        padding: 16px 20px;
        font-size: 10px;
    }
    
    /* Position popup at bottom on mobile */
    .ig-cm-customize-popup {
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
    
    .ig-cm-cookie-settings-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .ig-cm-cookie-settings-btn svg {
        width: 20px;
        height: 20px;
    }
}
