/**
 * VCookie Frontend Styles
 *
 * @package VGravity\VCookie
 */

/* CSS Variables (can be overridden via settings) */
:root {
    --vcookie-primary-color: #0073aa;
    --vcookie-secondary-color: #ffffff;
    --vcookie-text-color: #333333;
    --vcookie-button-text-color: #ffffff;
    --vcookie-primary-hover: #005a87;
    --vcookie-overlay-color: rgba(0, 0, 0, 0.5);
    --vcookie-border-radius: 8px;
    --vcookie-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --vcookie-z-index: 999999;
}

/* Reset */
.vcookie-banner *,
.vcookie-preferences *,
.vcookie-badge * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Banner */
.vcookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: var(--vcookie-z-index);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--vcookie-text-color);
}

/* Position Variants */
.vcookie-position-bottom {
    bottom: 0;
}

.vcookie-position-top {
    top: 0;
}

.vcookie-position-center {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vcookie-overlay-color);
}

/* Layout Variants */
.vcookie-layout-bar .vcookie-banner-container {
    background: var(--vcookie-secondary-color);
    box-shadow: var(--vcookie-shadow);
    padding: 20px;
}

.vcookie-layout-bar .vcookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.vcookie-layout-box .vcookie-banner-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 400px;
    background: var(--vcookie-secondary-color);
    border-radius: var(--vcookie-border-radius);
    box-shadow: var(--vcookie-shadow);
    padding: 25px;
}

.vcookie-layout-popup .vcookie-banner-container {
    background: var(--vcookie-secondary-color);
    border-radius: var(--vcookie-border-radius);
    box-shadow: var(--vcookie-shadow);
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

/* Banner Content */
.vcookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.vcookie-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--vcookie-text-color);
}

.vcookie-description {
    color: #666;
    margin-bottom: 10px;
}

.vcookie-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.vcookie-links a {
    color: var(--vcookie-primary-color);
    text-decoration: none;
    font-size: 13px;
}

.vcookie-links a:hover {
    text-decoration: underline;
}

/* Buttons */
.vcookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vcookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--vcookie-border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.vcookie-btn-accept-all {
    background: var(--vcookie-primary-color);
    color: var(--vcookie-button-text-color);
}

.vcookie-btn-accept-all:hover {
    background: var(--vcookie-primary-hover);
}

.vcookie-btn-necessary {
    background: transparent;
    color: var(--vcookie-text-color);
    border: 1px solid var(--vcookie-text-color);
}

.vcookie-btn-necessary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.vcookie-btn-customize {
    background: transparent;
    color: var(--vcookie-primary-color);
    padding: 12px 16px;
}

.vcookie-btn-customize:hover {
    text-decoration: underline;
}

.vcookie-btn-primary {
    background: var(--vcookie-primary-color);
    color: var(--vcookie-button-text-color);
}

.vcookie-btn-primary:hover {
    background: var(--vcookie-primary-hover);
}

.vcookie-btn-secondary {
    background: #e5e5e5;
    color: var(--vcookie-text-color);
}

.vcookie-btn-secondary:hover {
    background: #d5d5d5;
}

/* Preferences Modal */
.vcookie-preferences {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--vcookie-z-index) + 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.vcookie-preferences-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--vcookie-overlay-color);
    inset: 0;
}

.vcookie-preferences-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--vcookie-secondary-color);
    border-radius: var(--vcookie-border-radius);
    box-shadow: var(--vcookie-shadow);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.vcookie-preferences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.vcookie-preferences-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--vcookie-text-color);
}

.vcookie-preferences-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s;
}

.vcookie-preferences-close:hover {
    color: #333;
}

.vcookie-preferences-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.vcookie-preferences-intro {
    color: #666;
    margin-bottom: 20px;
}

/* Categories */
.vcookie-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vcookie-category {
    border: 1px solid #eee;
    border-radius: var(--vcookie-border-radius);
    overflow: hidden;
}

.vcookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    background: #f9f9f9;
}

.vcookie-category-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--vcookie-text-color);
}

.vcookie-category-info p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.vcookie-category-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.vcookie-always-on {
    font-size: 11px;
    color: #999;
}

/* Toggle Switch */
.vcookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.vcookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vcookie-switch .vcookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.vcookie-switch .vcookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.vcookie-switch input:checked + .vcookie-slider {
    background-color: var(--vcookie-primary-color);
}

.vcookie-switch input:checked + .vcookie-slider:before {
    transform: translateX(20px);
}

.vcookie-switch-disabled .vcookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cookie List */
.vcookie-category-cookies {
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.vcookie-toggle-cookies {
    background: none;
    border: none;
    color: var(--vcookie-primary-color);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.vcookie-toggle-cookies:hover {
    text-decoration: underline;
}

.vcookie-cookie-list {
    list-style: none;
    margin-top: 10px;
}

.vcookie-cookie-list li {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 8px;
}

.vcookie-cookie-list li:last-child {
    margin-bottom: 0;
}

.vcookie-cookie-list strong {
    display: block;
    font-size: 13px;
    color: var(--vcookie-text-color);
}

.vcookie-cookie-provider {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

.vcookie-cookie-list p {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0;
}

.vcookie-cookie-duration {
    font-size: 11px;
    color: #999;
    display: block;
    margin-top: 5px;
}

/* Preferences Footer */
.vcookie-preferences-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 25px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    flex-wrap: wrap;
}

/* Badge */
.vcookie-badge {
    position: fixed;
    z-index: calc(var(--vcookie-z-index) - 1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--vcookie-primary-color);
    color: var(--vcookie-button-text-color);
    border: none;
    cursor: pointer;
    box-shadow: var(--vcookie-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vcookie-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.vcookie-badge-bottom-left {
    bottom: 20px;
    left: 20px;
}

.vcookie-badge-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Animations */
.vcookie-animate-fade {
    animation: vcookieFadeIn 0.3s ease;
}

.vcookie-animate-slide.vcookie-position-bottom {
    animation: vcookieSlideUp 0.3s ease;
}

.vcookie-animate-slide.vcookie-position-top {
    animation: vcookieSlideDown 0.3s ease;
}

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

@keyframes vcookieSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes vcookieSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .vcookie-layout-bar .vcookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .vcookie-banner-text {
        min-width: auto;
    }
    
    .vcookie-banner-buttons {
        justify-content: center;
    }
    
    .vcookie-layout-box .vcookie-banner-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .vcookie-preferences-modal {
        width: 95%;
    }
    
    .vcookie-preferences-footer {
        justify-content: center;
    }
    
    .vcookie-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Print */
@media print {
    .vcookie-banner,
    .vcookie-preferences,
    .vcookie-badge {
        display: none !important;
    }
}
