/*
 * Subnet Calculator Pro - Cookie Consent Styles
 * Version: 1.0
 * Author: RCG Websites
 */

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg-light);
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10002;
    padding: 15px 20px;
    display: none; /* Hidden by default, shown by JS */
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

body.dark-mode .cookie-banner {
    background-color: var(--card-bg-dark);
    color: var(--text-dark);
    border-top-color: var(--border-dark);
}

.cookie-banner.show {
    display: flex;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

.cookie-text {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    font-size: 0.9rem;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.cookie-btn-accept {
    background-color: var(--primary-color);
    color: var(--button-text);
    border-color: var(--primary-color);
}
.cookie-btn-accept:hover {
    background-color: var(--secondary-color);
}

.cookie-btn-decline, .cookie-btn-prefs {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

body.dark-mode .cookie-btn-decline, 
body.dark-mode .cookie-btn-prefs {
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.cookie-btn-decline:hover, .cookie-btn-prefs:hover {
    background-color: rgba(0,0,0,0.05);
}
body.dark-mode .cookie-btn-decline:hover,
body.dark-mode .cookie-btn-prefs:hover {
    background-color: rgba(255,255,255,0.1);
}


/* Cookie Preferences Modal */
.cookie-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}
.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background-color: var(--card-bg-light);
    color: var(--text-light);
    padding: 0;
    border-radius: var(--container-border-radius);
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
body.dark-mode .cookie-modal-content {
    background-color: var(--card-bg-dark);
    color: var(--text-dark);
}

.cookie-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
body.dark-mode .cookie-modal-header {
    border-bottom-color: var(--border-dark);
}
.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--primary-color);
}
body.dark-mode .cookie-modal-header h3 {
    color: var(--link-color);
}
.cookie-modal-close {
    font-size: 1.8rem;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.cookie-modal-close:hover {
    color: var(--text-light);
}
body.dark-mode .cookie-modal-close:hover {
    color: var(--text-dark);
}

.cookie-modal-body {
    padding: 20px;
    overflow-y: auto;
}
.cookie-modal-body p {
    margin-top: 0;
    margin-bottom: 1.5em;
    font-size: 0.95rem;
}

.cookie-option {
    margin-bottom: 1.2em;
}
.cookie-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
}
.cookie-option p {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
    padding-left: 5px;
}
body.dark-mode .cookie-option p {
    color: #999;
}

/* Custom Toggle Switch for Cookie Preferences */
.cookie-option input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    width: 40px;
    height: 22px;
    background-color: var(--border-light);
    border-radius: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0; /* Prevent the switch from shrinking */
    border: none;
    outline-offset: 3px;
}

body.dark-mode .cookie-option input[type="checkbox"] {
    background-color: var(--border-dark);
}

.cookie-option input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.cookie-option input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

body.dark-mode .cookie-option input[type="checkbox"]:checked {
    background-color: var(--link-color);
}

.cookie-option input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.cookie-option input[type="checkbox"]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

body.dark-mode .cookie-option input[type="checkbox"]:disabled {
    background-color: #555;
}

.cookie-option input[type="checkbox"]:disabled:checked {
    background-color: var(--secondary-color);
}

body.dark-mode .cookie-option input[type="checkbox"]:disabled:checked {
    background-color: #155fa0;
}


.cookie-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}
body.dark-mode .cookie-modal-footer {
    border-top-color: var(--border-dark);
}

@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        gap: 15px;
    }
    .cookie-text {
        margin-bottom: 10px;
    }
}