/**
 * GreenIT - Legal Modals CSS
 * Styles for Terms of Service, Cookie Consent, and related components
 */

/* ===========================
   Base Modal Styles
   =========================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: block;
}

.modal .modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.modal .modal-header {
    background: linear-gradient(135deg, #1e6e52 0%, #00C853 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.modal .modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.modal .close-modal {
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0 0.25rem;
    opacity: 0.9;
}

.modal .close-modal:hover,
.modal .close-modal:focus {
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
}

.modal .modal-body {
    padding: 2rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    line-height: 1.7;
}

/* Custom scrollbar for modals */
.modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #00C853;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Cookie Banner Styles
   =========================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e6e52 0%, #00C853 100%);
    color: #ffffff;
    padding: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.active {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-banner-text h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.cookie-banner-text p {
    color: #E1F5EC;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    max-width: 700px;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-banner-actions .btn {
    white-space: nowrap;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cookie-banner-actions .btn-primary {
    background-color: #ffffff;
    color: #00C853;
}

.cookie-banner-actions .btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-banner-actions .btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.cookie-banner-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.cookie-banner-actions .btn-text {
    background-color: transparent;
    color: #E1F5EC;
    text-decoration: underline;
    padding: 12px 16px;
}

.cookie-banner-actions .btn-text:hover {
    color: #ffffff;
}

/* Cookie Notification */
.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #00C853;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-notification.active {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-banner-actions .btn {
        width: 100%;
    }
    
    .cookie-notification {
        left: 20px;
        right: 20px;
    }
}

/* ===========================
   Cookie Settings Modal
   =========================== */

.cookie-categories {
    margin-top: 24px;
}

.cookie-category {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.3s ease;
}

.cookie-category:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-category-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c5e4c;
    margin: 0;
}

.required-badge {
    background-color: #00C853;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-category-description {
    color: #5b8a7b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* Cookie Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .toggle-slider {
    background-color: #00C853;
}

.cookie-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .toggle-slider {
    background-color: #00C853;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cookie Details */
.cookie-list {
    margin-top: 16px;
}

.cookie-details-toggle {
    background-color: transparent;
    border: none;
    color: #00C853;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.cookie-details-toggle:hover {
    color: #00A040;
}

.cookie-details-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.cookie-details {
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

.cookie-table thead {
    background-color: #E1F5EC;
}

.cookie-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c5e4c;
    font-size: 0.9rem;
}

.cookie-table td {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #5b8a7b;
}

.cookie-table code {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1e6e52;
}

.cookie-policy-link {
    margin-top: 24px;
    padding: 16px;
    background-color: #E1F5EC;
    border-radius: 6px;
}

.cookie-policy-link p {
    margin: 0;
    color: #2c5e4c;
    font-size: 0.95rem;
}

.cookie-policy-link a {
    color: #00C853;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cookie-policy-link a:hover {
    color: #00A040;
    text-decoration: underline;
}

/* ===========================
   Legal Modal Enhancements
   =========================== */

.legal-modal .modal-intro {
    background-color: #E1F5EC;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #00C853;
    margin-bottom: 20px;
    color: #2c5e4c;
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-modal .last-updated {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    color: #5b8a7b;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 20px;
    display: inline-block;
}

.legal-modal h3 {
    color: #1e6e52;
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #E1F5EC;
}

.legal-modal ul,
.legal-modal ol {
    margin: 12px 0;
    padding-left: 24px;
    color: #5b8a7b;
    line-height: 1.7;
}

.legal-modal li {
    margin-bottom: 8px;
}

.legal-modal li strong {
    color: #2c5e4c;
}

.legal-modal p {
    color: #5b8a7b;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-modal a {
    color: #00C853;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.legal-modal a:hover {
    color: #00A040;
    text-decoration: underline;
}

.legal-notice {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 6px;
    margin-top: 24px;
    color: #856404;
}

.legal-notice strong {
    color: #856404;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-footer .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.modal-footer .btn-primary {
    background-color: #00C853;
    color: #ffffff;
}

.modal-footer .btn-primary:hover {
    background-color: #00A040;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.modal-footer .btn-secondary {
    background-color: #f0f0f0;
    color: #2c5e4c;
}

.modal-footer .btn-secondary:hover {
    background-color: #e0e0e0;
}

/* ===========================
   Responsive Design
   =========================== */

/* Base Modal Responsive */
@media (max-width: 768px) {
    .modal .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .modal .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .modal .modal-body {
        padding: 1.25rem;
        max-height: calc(85vh - 80px);
    }
    
    .modal .close-modal {
        font-size: 1.75rem;
    }
    
    .cookie-category {
        padding: 16px;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
    
    .cookie-table {
        font-size: 0.85rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 8px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .legal-modal .modal-body {
        font-size: 0.9rem;
    }
    
    .legal-modal h3 {
        font-size: 1rem;
    }
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    .cookie-banner,
    .cookie-notification,
    .modal-footer {
        display: none !important;
    }
    
    .legal-modal .modal-content {
        box-shadow: none;
        max-width: 100%;
        max-height: none;
        overflow: visible;
    }
}

