/* ==========================================================================
   Cookie Consent Banner - GDPR Compliant
   DosareJust.ro - Cookie Consent Styles
   ========================================================================== */

/* Overlay - semi-transparent background when settings panel is open */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Main Banner
   ========================================================================== */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Open Sans', sans-serif;
    border-top: 3px solid #1a5490;
}

.cookie-consent-banner.active {
    transform: translateY(0);
}

.cookie-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 30px;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

/* Icon + Text Section */
.cookie-consent-text {
    flex: 1;
    min-width: 280px;
}

.cookie-consent-text .cookie-icon {
    font-size: 28px;
    margin-right: 10px;
    vertical-align: middle;
}

.cookie-consent-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a5490;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.cookie-consent-text a {
    color: #1a5490;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent-text a:hover {
    color: #0d3b6e;
}

/* Buttons Section */
.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* Common button styles */
.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
    font-family: inherit;
    line-height: 1.4;
}

.cookie-btn:focus-visible {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

/* Accept All - Primary */
.cookie-btn-accept {
    background: #1a5490;
    color: #ffffff;
    border-color: #1a5490;
}

.cookie-btn-accept:hover {
    background: #0d3b6e;
    border-color: #0d3b6e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 84, 144, 0.3);
}

/* Reject All - Equal prominence as Accept */
.cookie-btn-reject {
    background: #ffffff;
    color: #1a5490;
    border-color: #1a5490;
}

.cookie-btn-reject:hover {
    background: #f0f4f8;
    border-color: #0d3b6e;
    color: #0d3b6e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 84, 144, 0.15);
}

/* Settings - Tertiary */
.cookie-btn-settings {
    background: transparent;
    color: #555;
    border-color: #ccc;
    font-size: 13px;
    padding: 10px 18px;
    min-width: auto;
}

.cookie-btn-settings:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* ==========================================================================
   Settings Panel
   ========================================================================== */
.cookie-settings-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    z-index: 100000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Open Sans', sans-serif;
    overflow-y: auto;
    border-top: 3px solid #1a5490;
}

.cookie-settings-panel.active {
    transform: translateY(0);
}

.cookie-settings-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.cookie-settings-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a5490;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
}

.cookie-settings-close:hover {
    background: #f0f0f0;
    color: #333;
}

.cookie-settings-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

/* Cookie Category */
.cookie-category {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: #ccc;
}

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

.cookie-category-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-category-badge.required {
    background: #d4edda;
    color: #155724;
}

.cookie-category-badge.optional {
    background: #fff3cd;
    color: #856404;
}

.cookie-category-description {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 12px;
}

/* Cookie table within category */
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 10px;
}

.cookie-table th {
    background: #e8edf2;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #d0d5dd;
}

.cookie-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.cookie-table tr:last-child td {
    border-bottom: none;
}

.cookie-table code {
    background: #e8edf2;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #333;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

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

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #1a5490;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #28a745;
    cursor: not-allowed;
    opacity: 0.8;
}

.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

/* Settings footer buttons */
.cookie-settings-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e8e8e8;
    flex-wrap: wrap;
}

.cookie-settings-footer .cookie-btn {
    min-width: 180px;
}

/* ==========================================================================
   Floating Re-open Button
   ========================================================================== */
.cookie-consent-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99997;
    background: #1a5490;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.cookie-consent-reopen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.cookie-consent-reopen:hover {
    background: #0d3b6e;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(26, 84, 144, 0.4);
}

.cookie-consent-reopen:focus-visible {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

.cookie-consent-reopen-tooltip {
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.cookie-consent-reopen:hover .cookie-consent-reopen-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .cookie-consent-inner {
        padding: 18px 16px;
    }

    .cookie-consent-content {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .cookie-consent-text {
        min-width: auto;
    }

    .cookie-consent-text h3 {
        font-size: 16px;
    }

    .cookie-consent-text p {
        font-size: 13px;
    }

    .cookie-consent-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .cookie-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .cookie-settings-inner {
        padding: 20px 16px;
    }

    .cookie-settings-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .cookie-table {
        display: block;
        overflow-x: auto;
    }

    .cookie-settings-footer {
        flex-direction: column;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }

    .cookie-consent-reopen {
        bottom: 15px;
        left: 15px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .cookie-consent-reopen-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .cookie-consent-inner {
        padding: 14px 12px;
    }

    .cookie-consent-text h3 {
        font-size: 15px;
    }

    .cookie-btn-settings {
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes cookieSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Consent version badge */
.cookie-consent-version {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-top: 10px;
}

/* Expandable cookie details within category */
.cookie-details-toggle {
    background: none;
    border: none;
    color: #1a5490;
    font-size: 13px;
    cursor: pointer;
    padding: 5px 0;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.cookie-details-toggle:hover {
    color: #0d3b6e;
    text-decoration: underline;
}

.cookie-details-toggle .arrow {
    transition: transform 0.2s;
    font-size: 10px;
}

.cookie-details-toggle.expanded .arrow {
    transform: rotate(90deg);
}

.cookie-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cookie-details-content.expanded {
    max-height: 500px;
}