/* Cookie Banner Frontend Styles */

/* Overlay */
.cookie-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    opacity: 0;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 20px;
}

/* Banner container */
.cookie-banner-container {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Header */
.cookie-banner-header {
    background: #f7f7f7;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cookie-banner-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.cookie-banner-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.cookie-banner-close:hover {
    /* Colors configured via admin settings */
}

/* Body */
.cookie-banner-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.cookie-banner-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Details */
.cookie-banner-details {
    margin-top: 20px;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-category {
    border-radius: 4px;
    padding: 16px;
    background: #fafafa;
}

.category-header {
    margin-bottom: 12px;
}

.category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
}

.category-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-toggle input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.category-name {
    flex: 1;
    color: #333;
}

.category-required {
    font-size: 13px;
    color: #666;
    font-weight: normal;
    line-height: 1.5;
}

.category-description {
    margin: 8px 0 12px 0;
    padding: 0;
}

.category-description p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.category-cookies-wrapper {
    margin-top: 12px;
}

.toggle-cookies-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #0073aa;
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.2s ease;
    text-align: left;
}

.toggle-cookies-button:hover {
    background: #f9f9f9;
    border-color: #0073aa;
}

.toggle-cookies-button .toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.category-cookies {
    margin-top: 12px;
}

.cookies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cookies-table thead {
    background: #f0f0f0;
}

.cookies-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
    line-height: 1.5;
}

.cookies-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
    line-height: 1.5;
}

.cookies-table code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: #d63384;
    line-height: 1.4;
}

/* Footer */
.cookie-banner-footer {
    background: #f7f7f7;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    white-space: nowrap;
    line-height: 1.5;
}

.cookie-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-btn-primary {
    background: #0073aa;
    color: #fff;
}

.cookie-btn-primary:hover {
    background: #005a87;
}

.cookie-btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.cookie-btn-secondary:hover {
    background: #f0f0f0;
}

.cookie-btn-text {
    background: transparent;
    color: #0073aa;
    min-width: auto;
}

.cookie-btn-text:hover {
    color: #005a87;
}

/* Settings trigger button */
.cookie-settings-trigger {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0073aa;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 99999;
    display: none;
    opacity: 0;
    align-items: center;
    justify-content: center;
    font-size:1.2em !important;
    border-radius:50% !important
}

.cookie-settings-trigger:hover {
    background: #005a87;
    transform: scale(1.1);
}

.cookie-settings-trigger svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 640px) {
    .cookie-banner-container {
        max-width: calc(100% - 40px);
        max-height: calc(100% - 40px);

        bottom:20px;
        left:20px;
        right:20px;
        position: absolute;
    }
    
    .cookie-banner-buttons {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        min-width: 100%;
    }
    
    .cookies-table {
        font-size: 13px;
    }
    
    .cookies-table th,
    .cookies-table td {
        padding: 6px;
    }
}

/* Cookie List Shortcode Styles */
.cookie-banner-list-wrapper {
    margin: 30px 0;
}

.cookie-banner-list-wrapper h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.cookie-category-section {
    margin-bottom: 40px;
}

.cookie-category-title {
    font-size: 20px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
}

.cookie-category-description {
    margin: 10px 0 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.cookie-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.cookie-list-table thead {
    background: #f7f7f7;
}

.cookie-list-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.cookie-list-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.cookie-list-table tbody tr:hover {
    background-color: #f9f9f9;
}

.cookie-list-table tbody td {
    padding: 12px 15px;
    font-size: 14px;
    color: #333;
    vertical-align: top;
}

.cookie-list-table code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
    color: #d63384;
    font-family: 'Courier New', Courier, monospace;
}

/* Responsive styles for shortcode table */
@media (max-width: 768px) {
    .cookie-list-table {
        font-size: 13px;
    }
    
    .cookie-list-table thead th,
    .cookie-list-table tbody td {
        padding: 10px 12px;
    }
    
    .cookie-list-table tbody td:first-child,
    .cookie-list-table tbody td:nth-child(2),
    .cookie-list-table tbody td:last-child {
        width: auto;
    }
}

@media (max-width: 640px) {
    .cookie-list-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .cookie-category-title {
        font-size: 18px;
    }
}

/* Panel View for Frontend Cookie Display */
.cookies-panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px 0;
}

.cookie-panel-item {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.cookie-panel-field {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.cookie-panel-field:last-child {
    margin-bottom: 0;
}

.cookie-panel-field strong {
    text-transform: uppercase;
    margin-bottom: 4px;
    font-size: 12px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.cookie-panel-field span {
    color: #333;
    line-height: 1.5;
}

.cookie-panel-field code {
    background: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
    border: 1px solid #ddd;
    color: #d63384;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .cookies-panel-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .cookie-panel-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .cookie-panel-field strong {
        font-size: 12px;
    }
}
