/* Modern theme variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    font-kerning: normal;
    letter-spacing: 0.02em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" on, "kern" on;
  }
  
  /* Use Montserrat for headings */
  h1, h2, h3, h4, h5, h6,
  .text-center-title, .kozlony-title {
    font-family: 'Montserrat', sans-serif;
    font-kerning: normal;
    letter-spacing: 0.04em;
    /* Additional styles for headings can be added here */
  }

/* ######################## header ################################### */
/* Header styling (within the content panel) */
.header-container {
    background-color: #fff;
    padding: 10px;
    text-align: center;
  }
  
.nav-buttons {
    position: relative;
    width: calc(100vw - 40px);  /* Leaves 20px margin on each side */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.center-archive {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
  
/* Show archive button only on desktop */
@media (min-width: 768px) {
    .archive-btn {
        flex-direction: column;
        align-items: center;
    }
  }
  
/* Mobile adjustments if needed */
@media (max-width: 768px) {
.nav-buttons {
    flex-direction: column;
    align-items: center;
}
.nav-buttons a, .nav-buttons button {
    width: 100%;
    margin: 5px 0;
}
}


.latest-issue-indicator {
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the content horizontally */
    gap: 0.5rem;
    margin: 0.5rem 0; /* Keep vertical margins, remove auto horizontal */
    padding: 0.5rem 1rem;
    background-color: #f0f9ff;
    border-radius: 0.5rem;
    width: 100%; /* Maintain full width of parent container */
    text-align: center; /* Center text content */
  }
  
  .pulse-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #22c55e;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
  }
  
  @keyframes pulse {
    0% { 
      transform: scale(1); 
      opacity: 1; 
    }
    50% { 
      transform: scale(1.2); 
      opacity: 0.7; 
    }
    100% { 
      transform: scale(1); 
      opacity: 1; 
    }
  }
  

/* ######################## Titles ######################## */
.text-center-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.text-center-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.glowing-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #22c55e;
    position: relative;
    animation: glow 2s ease-in-out infinite;
}

.glowing-circle::before,
.glowing-circle::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: #22c55e;
}

/* Inner glow */
.glowing-circle::before {
    inset: -4px;
    opacity: 0.4;
    filter: blur(4px);
}

/* Outer glow */
.glowing-circle::after {
    inset: -8px;
    opacity: 0.2;
    filter: blur(8px);
}

@keyframes glow {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.6; 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.status-indicator {
    margin: 0.5rem 0; /* 8px */
    gap: 0.5rem;
}

.status-text {
    color: var(--text-secondary);
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
}

/* ######################## Cards ######################## */
#errorMessage{
    display: none;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in-out;
}


.issue-floating-btn {
    position: fixed;
    top: 40px;             /* Adjust to place them lower/higher */
    z-index: 1000;
    padding: 10px 20px;     /* Smaller than your notification button */
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    /* If you want a consistent background color, uncomment:
       background-color: var(--primary-color);
       color: #fff;
    */
  }
  
.issue-btn-left {
left: 30px;
}

.issue-btn-right {
right: 30px;
}

.right-nav-buttons {
    display: flex;
    margin: 2px;
    margin-left: auto; /* This replicates ms-auto in LTR layouts */
}

@media (max-width: 768px) {
    .right-nav-buttons {
        width: 100%;
    }
}

/* Optional: on smaller screens, move them or hide them */
@media (max-width: 768px) {
.issue-floating-btn {
    /*top: 80px;
    padding: 8px 15px;
    disabled for now, TODO: add it to title banner and make it non floating
    */
    display: none;
}
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
  

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 0px 6px rgba(0, 0, 0, 0.1);
    border-top: 6px solid var(--primary-color) !important;
    max-width: 100%;
    width: 100%; /* Ensure it doesn't exceed the max-width */
}


.kozlony-card-header {
    display: flex;
    flex-direction: column;  /* Changed to column layout */
    padding: 1rem 1.5rem;
}

.kozlony-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kozlony-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
    position: relative;
}

.filename-container{
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.kozlony-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.0rem;
    letter-spacing: -0.01em;
}

.kozlony-date i {
    color: var(--text-secondary);
    font-size: 0.875rem;
}


.section-container {
    margin-bottom: 2rem;
    transition: background-color var(--transition-speed);
}

.section-container:hover {
    background-color: #f8fafc;
}


.reference-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-speed);
}

.reference-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}


.subheaders-wrapper {
    background-color: var(--background-color);
    padding: 0; /* Remove padding */
    margin: 0.5rem 0 2rem 0rem;
    border-left: 3px solid var(--primary-color); /* Keep the vertical line */
    height: 100%; /* Ensure the line spans the full height */
}

.subheader-container {
    background-color: var(--card-background);
    padding: 1.0rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border-left: 1px solid transparent;
}


.subheader-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ######### Badge styles ######### */

.category-badge {
    padding: 0.2em 0.5em;
    border-radius: 0.25em;
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: bold;
}

.badge-finance {
    background-color: #ffc107; /* Yellow */
    color: black;
}

.badge-work {
    background-color: #007bff; /* Blue */
    color: white;
}

.badge-health-social {
    background-color: #28a745; /* Green */
    color: white;
}

.badge-education-culture {
    background-color: #6f42c1; /* Purple */
    color: white;
}

.badge-environment-energy {
    background-color: #20c997; /* Teal */
    color: white;
}

.badge-transport-infrastructure {
    background-color: #fd7e14; /* Orange */
    color: white;
}

.badge-administration-law {
    background-color: #dc3545; /* Red */
    color: white;
}

.badge-technology-data {
    background-color: #17a2b8; /* Cyan */
    color: white;
}

.badge-security {
    background-color: #343a40; /* Dark */
    color: white;
}

.badge-default {
    background-color: #6c757d; /* Gray */
    color: white;
}

/* ######### End Badge styles ######### */
.copy-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    color: #dee2e6;
}

.copy-link-btn:hover {
    color: var(--primary-color);
}

.highlight {
    animation: highlight-fade 2s;
}

@keyframes highlight-fade {
    0% { background-color: #ffffc0; }
    100% { background-color: transparent; }
}


.subheader-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-speed);
    display: block;
    padding: 0.25rem 0;
}

.subheader-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subheader-container ul li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #334155;
}

#summary-list li:before{
    content: "•";
    color: #2563eb;
    position: absolute;
    left: 2rem;
    font-weight: bold;
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    .subheader-container ul li {
        padding-left: 1rem;
    }

    #summary-list li:before {
        left:0rem;
    }
}

#summary-list{
    margin-bottom: 2rem;
}


/* Reference list specific styling */
#reference-list {
    border-top: 1px solid #e2e8f0;
    margin-top: 1rem;
    padding-top: 1rem;
}

#reference-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

#reference-list li:last-child {
    border-bottom: none;
}



/* Gombok */
.kozlony-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;  /* Add space between title/date and buttons */
}

.kozlony-btn {
    background: none;
    border: none;
    padding: 0;
}

.kozlony-btn a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.kozlony-btn.download a {
    background-color: #ffffff; /* Light gray background */
    color: #334155; /* Dark text color */
    border: 1px solid #e2e8f0; /* Light gray border */
    border-radius: 8px; /* Rounded corners */
    padding: 6px 8px; /* Padding for spacing */
    font-size: 14px; /* Font size */
    text-decoration: none; /* Remove underline */
    display: inline-flex; /* Align icon and text */
    align-items: center; /* Center icon and text vertically */
    gap: 4px; /* Spacing between icon and text */
    transition: background-color 0.2s, box-shadow 0.2s; /* Add hover effect */
    line-height: 1;
}

.kozlony-btn.view a {
    background-color: #ffffff; /* Light gray background */
    color: #334155; /* Dark text color */
    border: 1px solid #e2e8f0; /* Light gray border */
    border-radius: 8px; /* Rounded corners */
    padding: 8px 12px; /* Padding for spacing */
    font-size: 14px; /* Font size */
    text-decoration: none; /* Remove underline */
    display: inline-flex; /* Align icon and text */
    align-items: center; /* Center icon and text vertically */
    gap: 4px; /* Spacing between icon and text */
    transition: background-color 0.2s, box-shadow 0.2s; /* Add hover effect */
}




/* Split View Layout */
.split-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    flex-direction: column; /* Stack vertically by default for mobile */
}

.content-panel {
    width: 100%; /* Full width on mobile */
    padding: 20px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.pdf-panel {
    position: fixed;
    top: auto; /* Reset top position */
    bottom: 0; /* Stick to bottom on mobile */
    right: 0;
    width: 100%; /* Full width on mobile */
    height: 0vh; /* Start with 0 height - if this is something else mobile view breaks */
    background: #f8fafc;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    overflow: hidden;
    transition: height 0.3s ease;
    z-index: 1000;
}

.split-active .content-panel {
    transform: none; /* Remove horizontal shift on mobile */
}

.split-active .pdf-panel {
    height: 50vh; /* Take up half the viewport height when active on mobile */
    width: 100%;
}

/* Desktop styles (min-width: 768px) */
@media (min-width: 768px) {
    .split-container {
        flex-direction: row; /* Side by side on desktop */
    }

    /* THIS SETS THE DESKTOP WIDTH */
    .content-panel {
        width: 50%;
    }

    .pdf-panel {
        top: 0;
        bottom: auto;
        width: 0;
        height: 100vh;
        border-left: 1px solid #e2e8f0;
        border-top: none;
    }

    .split-active .content-panel {
        transform: translateX(-50%); /* Restore horizontal shift on desktop */
    }

    .split-active .pdf-panel {
        width: 50%;
        height: 100vh;
    }
}

/* ######################## PDF Viewer ######################## */


#pdf-container {
    width: 100%;
    height: 100%; /* this needs to be specified for scrolling */
    overflow-y: auto; /* Enable scrolling */
    position: relative;
}

#pdf-container canvas {
    display: block;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.close-pdf-btn {
    position: absolute;
    top: 10px; /* Adjust spacing from top */
    right: 10px; /* Adjust spacing from right */
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    color: #ffffff; /* White text */
    border: none;
    border-radius: 50%; /* Circular shape */
    font-size: 1.5rem; /* Font size for the "X" */
    width: 40px; /* Width of the button */
    height: 40px; /* Height of the button */
    line-height: 40px; /* Center vertically */
    text-align: center; /* Center horizontally */
    cursor: pointer;
    z-index: 1100; /* Ensure it appears above everything */
    transition: background 0.3s ease;
}

.close-pdf-btn:hover {
    background: rgba(0, 0, 0, 0.8); /* Darker background on hover */
}

.pdf-navigation {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px;
    text-align: center;
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.pdf-navigation button {
    margin: 0 10px;
    padding: 5px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}


/* ######################## Footer ######################## */

.footer {
    background-color: #f8f9fa;
    padding: 10px 0;
    margin-top: 40px;
    border-top: 1px solid #dee2e6;
}

/* for mobile footer */
@media (max-width: 768px) {
    .footer {
        background-color: #f8f9fa;
        padding: 10px 0;
        margin-top: 40px;
        border-top: 1px solid #dee2e6;
        padding-bottom: 60px;
    }
}

.footer-content {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}
.footer-content a {
    color: #007bff;
    text-decoration: none;
}
.footer-content a:hover {
    text-decoration: underline;
}

/* ######################## NOTIFICATIONS ################################## */
.toast {
    color: #fff !important;
}
.toast-success {
    background-color: #51A351 !important; /* Green for success */
}
.toast-error {
    background-color: #BD362F !important; /* Red for error */
}
.toast-warning {
    background-color: #F89406 !important; /* Yellow for warnings (e.g., already registered email) */
}
.toast-info {
    background-color: #2F96B4 !important; /* Blue for informational messages */
}

.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: var(--primary-color);
}

.modal-content {
    border-radius: 15px;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
    border-radius: 16px 16px 0 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    border: 32px 32px 0 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.5rem;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    margin: 0.2rem;
    font-size: 0.9rem;
}

.keyword-tag .remove-keyword {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #6c757d;
    font-weight: bold;
}

.keyword-tag .remove-keyword:hover {
    color: #dc3545;
}

.gap-2 {
    gap: 0.5rem;
}

.doc-types {
    border-left: 2px solid var(--text-primary);
    margin-top: 0.5rem;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}

.user-type-icon {
    transition: transform 0.3s, color 0.3s;
}

.user-type-icon.active {
color: var(--primary-color);
transform: scale(1.1);
}

#individualForm {
    background-color: var(--card-background);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  #individualForm .form-control {
    border-radius: 8px;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
  }
  
  #individualForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
  }
  
  /* Style for the "Add Keyword" button */
  #individualForm #addKeywordBtn {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
    font-weight: 600;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
  }
  
  #individualForm #addKeywordBtn:hover {
    background-color: #1e5bb8; /* slightly darker than primary */
    border-color: #1e5bb8;
  }
  
  /* Style for the submit button in Individual Form */
  #individualForm button[type="submit"] {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
    font-weight: 600;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
  }
  
  #individualForm button[type="submit"]:hover {
    background-color: #1e5bb8;
    border-color: #1e5bb8;
  }

#companyForm {
    background-color: var(--card-background);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  #companyForm .form-control {
    border-radius: 8px;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
  }
  
  #companyForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
  }
  
  #companyForm #fillFieldsButton {
    background-color: #ccc; /* Disabled color */
    border: 1px solid #ccc;
    color: #fff;
    font-weight: 600;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
  }
  
  #companyForm #fillFieldsButton:not(:disabled) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
  }
  
  #companyForm #fillFieldsButton:not(:disabled):hover {
    background-color: #1e5bb8; /* Slightly darker than primary */
    border-color: #1e5bb8;
  }

/* ########################################################## */