@import url('https://fonts.googleapis.com/css2?family=Helvetica+Neue:wght@400;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

html {
    transform: scale(0.8);
    transform-origin: top left;
    width: 125%;
    height: 125%;
    overflow-x: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}


.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.brand {
    font-family: "Helvetica Neue", sans-serif;
    font-weight: bold;
    font-style: italic;
    font-size: 2rem;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background-color: #333;
}

.app-container {
    width: 100%;
    padding: 2rem;
    background-color: #f5f5f5;
    overflow-x: hidden;
    position: relative;
}

.app-header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background-color: #000;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-left: auto; /* This will push the button to the right if it's not in a container */
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.listing-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    text-align: center;
    font-weight: 500;
}

.listing-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.new-listing {
    border: 2px dashed #ccc;
    background: transparent;
    color: #666;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .listings-grid {
        grid-template-columns: 1fr;
    }
}

.error-message {
    background-color: #ff5252;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.table-container {
    overflow-x: auto;
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f8f8;
    font-weight: 600;
    cursor: pointer;
}

th:hover {
    background: #eee;
}

tr:hover {
    background: #f5f5f5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    color: #000;
    text-decoration: none;
    font-weight: 500;
}

.add-offer-btn {
    padding: 0.5rem 1rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-offer-btn:hover {
    background: #333;
}

.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.upload-box {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.upload-box.dragover {
    border-color: #000;
    background: #f8f8f8;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #000;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

.processing {
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-form {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.preview-form h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.breadcrumb {
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #000;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.saving-indicator {
    color: #666;
    font-style: italic;
}

.last-saved {
    color: #666;
    font-size: 0.9rem;
}

.offer-form {
    grid-column: 1 / 2;
}

.history-panel {
    grid-column: 2 / 3;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    position: relative;
}

.history-item.version-change {
    background-color: #f5f5f5;
    border-left: 3px solid #1a73e8;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.version-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background-color: #1a73e8;
    color: white;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Style for manual changes */
.manual-change .version-badge, .version-badge.manual-badge {
    background-color: #ff8c00; /* Orange color for manual changes */
}

/* Ensure manual change items have distinct styling */
.history-item.manual-change {
    border-left: 3px solid #ff8c00;
}

.history-item-content {
    margin-bottom: 0.5rem;
}

.change-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
}

.old-value {
    color: #4CAF50;
    word-break: break-word;
    max-width: 40%;
}

.new-value {
    color: #ff4444;
    word-break: break-word;
    max-width: 40%;
}

.history-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.revert-button, .view-version-button {
    width: auto; /* Override global width */
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    color: black; /* Override global text color */
}

.revert-button {
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.revert-button:hover {
    background: #eee;
}

.view-version-button {
    background-color: #006340;
    color: white;
    border: none;
}

.view-version-button:hover {
    background-color: #00512d;
}

.offer-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.offer-row:hover {
    background-color: #f5f5f5;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn {
    background-color: #006340;
    color: white;
    border: none;
}

.delete-btn {
    background-color: #ff4444;
    color: white;
    border: none;
}

.edit-btn:hover, .delete-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .offer-explorer {
        grid-template-columns: 1fr;
    }
    .history-panel {
        grid-column: 1 / -1;
    }
}

.form-group.full-width {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

.form-group.full-width textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    padding: 0.5rem;
}

.offer-explorer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    align-items: start;
}

/* Keep the history panel in place */
.history-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Breadcrumb Styles */
.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    overflow-x: auto;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    margin-right: 0.5rem;
}

.breadcrumb a:hover {
    color: #000;
}

.breadcrumb span {
    color: #000;
    margin-right: 0.5rem;
}

.breadcrumb a::after, .breadcrumb span::after {
    content: '>';
    margin-left: 0.5rem;
    color: #ccc;
}

.breadcrumb a:last-child::after, .breadcrumb span:last-child::after {
    content: '';
    margin-left: 0;
}


/* Navigation Alignment */
.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
}

/* Logout Button */
.logout-btn {
    padding: 0.5rem 1rem;
    background-color: #000;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.logout-btn:hover {
    background-color: #333;
}

/* Footer Logo */
.footer-logo {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
}

.listing-name {
    font-family: "Helvetica Neue", sans-serif;
    font-style: italic;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    margin: 1rem 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0;
    }
    
    .nav-right {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .add-offer-btn, .logout-btn {
        margin-top: 0.5rem;
    }
    
    .listing-name {
        font-size: 1.5rem;
    }

    .footer-logo {
        bottom: 0.5rem;
        right: 0.5rem;
        font-size: 1.2rem;
    }
}

html {
    scroll-behavior: smooth;
}

.export-btn {
    padding: 0.5rem 1rem;
    background-color: #006340; /* Forest green */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 0.5rem;
}

.export-btn:hover {
    background-color: #006340;
}

.comments-cell {
    max-height: 5rem;        /* pick a height that keeps rows from ballooning */
    overflow-y: auto;        /* allow vertical scrolling for long text */
    white-space: pre-wrap;   /* preserve line breaks, allow wrapping */
    word-wrap: break-word;   /* ensure long words wrap properly */
  }

  @media (max-width: 992px) {
    th, td {
      padding: 0.5rem;       /* reduce cell padding */
      font-size: 0.9rem;     /* slightly smaller text */
    }
    
    table {
      min-width: 800px;      /* tighten even more for narrower layouts */
    }
  }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box; /* Helps maintain consistent width/padding */
}

/* Force the textarea to have a reasonable height, matching the text fields */
.form-group textarea {
    resize: vertical;  /* or 'none' if you don't want manual resizing */
    min-height: 3em;   /* or pick a height that works best for your layout */
}

/* Side panels container */
.side-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Versions panel styling */
.versions-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.versions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.version-item {
    padding: 0.75rem;
    border: 1px solid #eee;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.version-item:hover {
    background-color: #f9f9f9;
}

.current-version {
    background-color: #f5f5f5;
    border-left: 3px solid #006340;
}

.version-info {
    flex: 1;
}

.version-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.version-label {
    font-weight: 500;
}

.version-date, .upload-date {
    color: #666;
    font-size: 0.9rem;
    display: block;
}

.version-price {
    font-weight: bold;
}

.version-actions {
    display: flex;
    gap: 0.5rem;
}

.view-button, .download-button {
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    border: none;
}

.view-button {
    background-color: #006340;
}

.download-button {
    background-color: #1a73e8;
}

/* History header styles */
.history-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-label {
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
}

.toggle-label input {
    margin-right: 4px;
}