/**
 * APL Cookie Consent - Styles
 * GDPR/LGPD Compliant with Cookie Categories
 */

/* ============================================
   Base Banner Styles
   ============================================ */

#apl-cc {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

#apl-cc *, #apl-cc *::before, #apl-cc *::after {
    box-sizing: inherit;
}

/* Hidden state */
#apl-cc.apl-cc-hidden {
    display: none !important;
}

/* ============================================
   Position Classes
   ============================================ */

#apl-cc.apl-cc-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

#apl-cc.apl-cc-top {
    top: 0;
    left: 0;
    right: 0;
}

#apl-cc.apl-cc-bottom-left {
    bottom: 20px;
    left: 20px;
    max-width: 420px;
}

#apl-cc.apl-cc-bottom-right {
    bottom: 20px;
    right: 20px;
    max-width: 420px;
}

/* ============================================
   Layout Styles
   ============================================ */

/* Bar Layout */
#apl-cc.apl-cc-bar .apl-cc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

#apl-cc.apl-cc-bar .apl-cc-content {
    flex: 1;
    min-width: 250px;
}

/* Box Layout */
#apl-cc.apl-cc-box {
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#apl-cc.apl-cc-box .apl-cc-inner {
    padding: 24px;
}

#apl-cc.apl-cc-box .apl-cc-content {
    margin-bottom: 16px;
}

#apl-cc.apl-cc-box .apl-cc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#apl-cc.apl-cc-box .apl-cc-btn {
    width: 100%;
    justify-content: center;
}

/* Popup Layout (Center) */
#apl-cc.apl-cc-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: calc(100% - 40px);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

#apl-cc.apl-cc-popup::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

#apl-cc.apl-cc-popup .apl-cc-inner {
    padding: 28px;
}

#apl-cc.apl-cc-popup .apl-cc-content {
    margin-bottom: 20px;
    text-align: center;
}

#apl-cc.apl-cc-popup .apl-cc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================
   Content Styles
   ============================================ */

.apl-cc-message {
    margin: 0 0 8px 0;
}

.apl-cc-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.apl-cc-policy,
.apl-cc-terms {
    font-size: 13px;
    text-decoration: underline;
    opacity: 0.9;
}

.apl-cc-policy:hover,
.apl-cc-terms:hover {
    opacity: 1;
}

.apl-cc-link-separator {
    opacity: 0.5;
    font-size: 12px;
}

/* ============================================
   Button Styles
   ============================================ */

.apl-cc-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.apl-cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    min-width: 100px;
}

.apl-cc-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.apl-cc-btn:active {
    transform: translateY(0);
}

.apl-cc-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ============================================
   Animation Classes
   ============================================ */

#apl-cc.apl-cc-anim-slide {
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}

#apl-cc.apl-cc-anim-fade {
    transition: opacity 0.35s ease-out;
}

#apl-cc.apl-cc-anim-none {
    transition: none;
}

/* ============================================
   Revoke Button
   ============================================ */

#apl-cc-revoke {
    position: fixed;
    z-index: 999998;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#apl-cc-revoke:hover {
    transform: scale(1.08);
}

#apl-cc-revoke.apl-cc-hidden {
    display: none !important;
}

#apl-cc-revoke.apl-cc-bottom,
#apl-cc-revoke.apl-cc-bottom-left {
    bottom: 20px;
    left: 20px;
}

#apl-cc-revoke.apl-cc-bottom-right {
    bottom: 20px;
    right: 20px;
}

#apl-cc-revoke.apl-cc-top {
    top: 20px;
    left: 20px;
}

/* ============================================
   Preferences Modal
   ============================================ */

#apl-cc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#apl-cc-modal.apl-cc-modal-hidden {
    display: none !important;
}

.apl-cc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.apl-cc-modal-content {
    position: relative;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.apl-cc-modal-content h3 {
    margin: 0 0 24px 0;
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   Cookie Categories
   ============================================ */

.apl-cc-categories {
    margin-bottom: 24px;
}

.apl-cc-category {
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.apl-cc-category:last-child {
    margin-bottom: 0;
}

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

.apl-cc-cat-header label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}

.apl-cc-cat-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: currentColor;
}

.apl-cc-cat-header input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.apl-cc-always-on {
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apl-cc-cat-desc {
    margin: 0;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.5;
}

/* Modal Actions */
.apl-cc-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.apl-cc-modal-actions .apl-cc-btn {
    flex: 1;
    min-width: 140px;
}

/* Modal Privacy Policy Link */
.apl-cc-modal-policy {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 4px;
}

.apl-cc-modal-policy .apl-cc-policy {
    font-size: 14px;
    opacity: 0.85;
}

.apl-cc-modal-policy .apl-cc-policy:hover {
    opacity: 1;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    #apl-cc.apl-cc-bar .apl-cc-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    #apl-cc.apl-cc-bar .apl-cc-content {
        width: 100%;
    }
    
    #apl-cc.apl-cc-bar .apl-cc-actions {
        width: 100%;
        justify-content: center;
    }
    
    #apl-cc.apl-cc-bottom-left,
    #apl-cc.apl-cc-bottom-right {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .apl-cc-modal-content {
        padding: 20px;
    }
    
    .apl-cc-modal-actions {
        flex-direction: column;
    }
    
    .apl-cc-modal-actions .apl-cc-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .apl-cc-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .apl-cc-btn {
        width: 100%;
    }
    
    #apl-cc-revoke {
        bottom: 10px;
        left: 10px;
    }
    
    #apl-cc-revoke.apl-cc-bottom-right {
        left: auto;
        right: 10px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    #apl-cc,
    #apl-cc-revoke,
    .apl-cc-btn {
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .apl-cc-btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   Print - Hide everything
   ============================================ */

@media print {
    #apl-cc,
    #apl-cc-modal,
    #apl-cc-revoke {
        display: none !important;
    }
}
