/* Bootstrap-friendly Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 900px; /* Increased from 800px */
    max-height: 90vh; /* Increased from 80vh */
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    background: linear-gradient(90deg, #004880 0%, #0068b4 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
    color: white;
    text-align: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
    color: #212529;
}

/* Additional Bootstrap-friendly styles */
.modal-body h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #212529;
}

.modal-body h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #212529;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body a {
    color: #0068b4;
    text-decoration: none;
    font-weight: 500;
}

.modal-body a:hover {
    text-decoration: underline;
}

/* Email styling */
.modal-body .email-link,
.address a {
    display: inline-flex;
    align-items: center;
    margin: 5px 0;
    color: #0068b4;
    font-weight: 500;
    transition: color 0.2s ease;
}

.modal-body .email-link:hover,
.address a:hover {
    color: #004880;
}

.modal-body .email-icon,
.address .fa-envelope {
    margin-right: 8px;
    color: #0068b4;
    font-size: 1.1em;
    transition: transform 0.2s ease;
}

.modal-body .email-link:hover .email-icon,
.address a:hover + .fa-envelope,
.address span:hover .fa-envelope {
    transform: translateX(2px);
}

.modal-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body ol li {
    margin-bottom: 1rem;
}

/* Make text more readable */
.modal-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* For the privacy policy list items */
.modal-body ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body ul li {
    margin-bottom: 0.75rem;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #0068b4;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #004880;
}

/* Adjust modal size based on content type */
#privacy-modal .modal-container,
#terms-modal .modal-container {
    max-width: 1000px; /* Even larger for text-heavy content */
    max-height: 95vh;
}

/* Bootstrap compatible button styles */
.modal-body .btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-body .btn-primary {
    color: #fff;
    background-color: #0068b4;
    border-color: #0068b4;
}

.modal-body .btn-primary:hover {
    color: #fff;
    background-color: #004880;
    border-color: #004880;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .modal-container {
        width: 95%;
        max-width: none;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1rem;
        font-size: 0.95rem;
    }
}
/* Stylizacja dla modalu kontaktowego */
#contact-modal .company-logo-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    width: 200px;
    padding: 10px;
}

#contact-modal .company-logo {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    background: white;
    /* efekt 3D: cień i lekka perspektywa, podobnie jak w .logo-cumulus */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#contact-modal .company-logo:hover {
    transform: scale(1.2) rotateX(3deg) rotateY(3deg);
    box-shadow: 0 10px 20px rgba(0, 140, 186, 0.4);
}

#contact-modal .company-name {
    font-size: 1.8rem;
    color: #0073b7;
    font-weight: 600;
    margin-bottom: 15px;
}

#contact-modal .contact-details {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#contact-modal .address-line {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 5px;
}

#contact-modal .contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

#contact-modal .contact-icon {
    font-size: 1.3rem;
    color: #0073b7;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

#contact-modal .contact-link,
#contact-modal .contact-text {
    font-size: 1.2rem;
    color: #0073b7;
    font-weight: 500;
    text-decoration: none;
}

#contact-modal .contact-link:hover {
    text-decoration: underline;
    color: #005a94;
}

#contact-modal .contact-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#contact-modal .modal-container {
    max-width: 600px;
}
.contact-footer {
    background: linear-gradient(180deg, #0096d6 0%, #0073b7 100%);
    padding: 3px;
    color: #fff;
    border-radius: 4px 4px 0 0;
  }

#contact-modal .btn-primary {
    background-color: #0073b7;
    border-color: #0073b7;
    padding: 10px 20px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#contact-modal .btn-primary:hover {
    background-color: #005a94;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dictionary modal - najwyższy priorytet, zawsze na wierzchu */
.dictionary-modal {
    z-index: 99999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.dictionary-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.dictionary-modal .modal-container {
    z-index: 99999999 !important;
    position: relative !important;
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}

/* Item modal - dla edycji/podglądu/tworzenia */
.item-modal {
    z-index: 999999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.item-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.item-modal .modal-container {
    z-index: 999999999 !important;
    position: relative !important;
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}

/* History modal - dla bazy wiedzy */
#history-modal {
    z-index: 999999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

#history-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

#history-modal .modal-container {
    z-index: 999999999 !important;
    position: relative !important;
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}
