/* ==================== Global Styles ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f7f7;
    margin: 0;
    padding: 0;
    color: #1a1a1a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    min-height: 90vh;
}

/* ==================== Navbar ==================== */
header {
    background-color: #FF0000;
    padding: 15px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin-bottom: 30px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar-item {
    margin-right: 20px;
}

.navbar-item .button {
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 12px 18px;
    border-radius: 8px;
    background-color: #FF0000;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.navbar-item .button:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

/* ==================== Welcome + Page Title ==================== */
.welcome-message {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-align: center;
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.page-title h1 {
    font-size: 2.2em;
    font-weight: 800;
    color: #FF0000;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.filters {
    display: flex;
    gap: 12px;
}

.filter-button {
    padding: 8px 16px;
    background-color: white;
    border: 2px solid #FF0000;
    color: #FF0000;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.filter-button.active,
.filter-button:hover {
    background-color: #FF0000;
    color: white;
    transform: scale(1.05);
}

/* ==================== Column Layout ==================== */
.contract-columns {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.contract-column {
    flex: 1;
    min-width: 45%;
    padding: 20px;
    border-radius: 12px;
    background-color: #fff;
}

.general-glow {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.25);
}

.transit-glow {
    box-shadow: 0 0 15px rgba(0, 200, 0, 0.25);
}

/* ==================== Contract List ==================== */
.contract-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

/* Base contract card styling (shrunken bubble mode) */
.contract-item {
    max-width: 300px; /* roughly 1/3 of standard desktop width */
    margin: 10px auto;
    padding: 10px 14px;
    font-size: 0.85em;
    border: 1px solid #ddd;
    border-left: 3px solid #ccc;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Hover for slight feedback */
.contract-item:hover {
    background-color: #f9f9f9;
}

/* Hide full content initially */
.contract-details,
.contract-image-container,
.contract-status,
.contract-actions {
    display: none;
}

/* EXPANDED STATE */
.contract-item.open {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
}

/* Reveal on expand */
.contract-item.open .contract-details,
.contract-item.open .contract-image-container,
.contract-item.open .contract-status,
.contract-item.open .contract-actions {
    display: block;
    margin-top: 10px;
}

/* Responsive tweak for mobile */
@media (max-width: 768px) {
    .contract-item {
        max-width: 95%;
        font-size: 0.8em;
    }
}



.contract-item:hover {
    background-color: #fefefe;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.contract-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contract-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #111;
    margin-bottom: 3px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contract-meta {
    font-size: 0.9em;
    color: #666;
}

.contract-meta span {
    color: #444;
    font-weight: 500;
}

.contract-image-container {
    width: 100%;
    max-width: 420px;
    margin: 10px 0;
    padding: 12px;
    text-align: center;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.contract-image-container img {
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.contract-image-container img:hover {
    transform: scale(1.05);
}

.contract-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-details-btn {
    background-color: #e2e8f0; /* light gray-blue */
    color: #333;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .toggle-details-btn:hover {
    background-color: #cbd5e0; /* darker gray-blue */
  }
  

.contract-details {
    display: none;
    padding: 12px;
    background-color: #f9f9f9;
    border-left: 4px solid #FF0000;
    border-radius: 8px;
    color: #333;
}

.contract-status {
    font-size: 0.95em;
    font-weight: bold;
    color: #555;
}

/* ==================== Buttons Shared ==================== */
.delete-button,
.add-button,
.button {
    background-color: #f87171;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.delete-button:hover,
.add-button:hover,
.toggle-details-btn:hover,
.button:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .contract-columns {
        flex-direction: column;
    }
    .contract-column {
        min-width: 100%;
    }
}

/* ==================== Payment Section ==================== */
.profile-payment,
.profile-payment-add {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #fafafa;
}

.profile-payment h2,
.profile-payment-add h3 {
    color: #FF0000;
    margin-bottom: 10px;
}

.qr-label {
    margin-top: 10px;
    font-weight: 600;
    color: #444;
}

/* ==================== Chat Box ==================== */
.chat-box {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    background-color: #fcfcfc;
    border-radius: 10px;
}

.chat-status {
    font-weight: bold;
    margin-bottom: 10px;
}

.chat-status.open {
    color: green;
}

.chat-status.locked {
    color: red;
}

.chat-messages {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 10px;
}

.chat-message {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.timestamp {
    color: #888;
    font-size: 0.8em;
}

.message-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1em;
    resize: none;
    margin-bottom: 10px;
}

.message-form button {
    float: right;
}

/* ==================== Summary ==================== */
.summary-box {
    margin-top: 40px;
    padding: 20px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
}

.summary-box h2 {
    color: #FF0000;
    margin-bottom: 10px;
}

.summary-box p {
    font-size: 1em;
    margin: 6px 0;
    color: #333;
}

/* ==================== Profile Sections (Payment + Proposals) ==================== */
.profile-payment,
.profile-payment-add,
.proposals-sent,
.proposals-received {
    max-width: 700px;
    margin: 40px auto;
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    border-left: 6px solid #FF0000;
}

.profile-payment h2,
.profile-payment-add h3,
.proposals-sent h2,
.proposals-received h2 {
    margin-top: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #FF0000;
    text-align: center;
    margin-bottom: 20px;
}

.profile-payment label,
.profile-payment-add label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
}

.profile-payment select,
.profile-payment input[type="text"],
.profile-payment-add select,
.profile-payment-add input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
}

.profile-payment .button,
.profile-payment-add .button {
    margin-top: 10px;
}

/* QR Code display */
#qr-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

#qr-code-display > div {
    margin: 0 auto;
}

.qr-label {
    text-align: center;
    color: #888;
    font-size: 0.85em;
    margin-top: 10px;
}

/* Proposals Lists */
.proposals-sent ul,
.proposals-received ul {
    list-style: none;
    padding: 0;
}

.proposals-sent li,
.proposals-received li {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 0.95em;
}

.proposals-sent li strong,
.proposals-received li strong {
    color: #111;
}

.proposals-sent li em,
.proposals-received li em {
    font-style: italic;
    color: #555;
}

.proposals-sent li small,
.proposals-received li small {
    color: #999;
    font-size: 0.8em;
}

.proposals-received .button {
    margin-top: 10px;
    margin-right: 10px;
}

/* === Sign In Page Centering === */
.auth-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    background-color: #1a1a1a;
    color: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

.auth-card input {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #333;
    color: #fff;
}

@media (max-width: 768px) {
  .contract-columns {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 1.5rem;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .contract-column {
    width: 100%;
    max-width: 95vw;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
  }

  .contract-item {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .contract-container {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .contract-name {
    font-size: 1rem;
    word-wrap: break-word;
  }

  .contract-meta,
  .contract-status {
    font-size: 0.85rem;
  }

  .contract-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
  }

  .toggle-details-btn,
  .delete-button,
  .save-description-btn {
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  .description-textarea {
    width: 100%;
    font-size: 0.9rem;
    box-sizing: border-box;
  }
}
