/* High-End Glassmorphism Cookie Consent Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

.cookie-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1100px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 20px 28px;
    z-index: 99999;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

.cookie-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-grow: 1;
}

.cookie-icon-box {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.cookie-text-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cookie-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cookie-description {
    font-size: 13.5px;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

.cookie-link {
    color: #2563eb !important;
    text-decoration: none !important;
    font-weight: 600;
    border-bottom: 1.5px solid rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}

.cookie-link:hover {
    color: #1d4ed8 !important;
    border-bottom-color: #1d4ed8;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Outlined button for settings */
.btn-cookie-outline {
    background: transparent !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cookie-outline:hover {
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    background: rgba(241, 245, 249, 0.5) !important;
}

/* Primary button for accept */
.btn-cookie-primary {
    background: linear-gradient(135deg, #1e3a8a, #16214f) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 11px 26px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
    transition: all 0.2s ease !important;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cookie-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.35);
    filter: brightness(1.1);
}

/* Responsive constraints */
@media (max-width: 991px) {
    .cookie-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .cookie-actions {
        justify-content: flex-end;
    }
}

/* Sliding Sidebar Settings Panel */
.cookie-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    max-width: 100%;
    background-color: #ffffff;
    z-index: 999999;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    border-left: 1px solid #f1f5f9;
}

.cookie-sidebar.closed {
    transform: translateX(100%);
}

.cookie-sidebar-header {
    background-color: #16214f;
    padding: 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-sidebar-btn {
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    transition: color 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.close-sidebar-btn:hover {
    color: #ffffff;
}

.cookie-sidebar-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-card-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s;
}

.cookie-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.cookie-card-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* iOS Toggle style for checkbox */
.form-switch {
    padding-left: 2.5em;
    margin-bottom: 0;
}

.form-switch .form-check-input {
    width: 42px;
    height: 24px;
    margin-left: -2.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e") !important;
    background-position: left center;
    border-radius: 2em;
    border: 1.5px solid #cbd5e1;
    transition: background-position .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;
    background-color: #cbd5e1;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.btn-save-setting {
    background: linear-gradient(135deg, #1e3a8a, #16214f) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    width: 100%;
    padding: 14px !important;
    border-radius: 10px !important;
    text-align: center;
    display: block;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.btn-save-setting:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.35);
    filter: brightness(1.1);
}

.cookie-sidebar-footer {
    padding: 16px 24px 24px;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
}

/* Floating settings recovery icon button */
.cookie-open-setting {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-open-setting:hover {
    transform: scale(1.1) rotate(15deg);
}

.img-cookie-setting {
    background: linear-gradient(135deg, #1e3a8a, #16214f);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
}
