:root {
    --primary-color: #173347; 
    --secondary-color: #234867;   
    --background-color: #e2e8f0;  
    --success-color: #22c55e;     
    --danger-color: #ef4444;      
    --text-color: #1e293b;        
    --card-bg: #ffffff;           
    --hover-color: #0c1a24;       
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #94a3b8, #64748b); 
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #173347, #234867);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    position: relative; 
}

.header h1 {
    font-size: 2.5em;
}

.header h1 .emoji {
    font-size: 1.2em;
}

.btn-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.btn-fullscreen:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

.btn-fullscreen.active .fullscreen-icon {
    transform: rotate(180deg);
}

.fullscreen-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

:fullscreen {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
}

:-webkit-full-screen {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
}

.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95); 
    color: var(--text-color);
    border: 1px solid rgba(23, 51, 71, 0.2);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    min-width: 150px;
}

.tab .emoji {
    font-size: 2em;
    margin-bottom: 8px;
}

.tab:hover {
    background-color: var(--hover-color);
    color: white;
    transform: translateY(-2px);
}

.tab.active {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    background-color: rgba(255, 255, 255, 0.95); 
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgb(0, 0, 0 / 0.1);
    margin-bottom: 25px;
    border: 1px solid rgba(23, 51, 71, 0.2); 
}

.section h2 .emoji {
    font-size: 1.5em;
    margin-right: 10px;
}

.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.table-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgb(0, 0, 0 / 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.table-card:hover {
    transform: translateY(-5px);
    opacity: 0.9;
}

.table-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.table-card p {
    margin: 0;
}

.table-card h3,
.table-card p {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.table-free {
    background-color: #22c55e;
    border: none;
    color: white;
}

.table-occupied {
    background-color: #f97316;
    border: none;
    color: white;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    transition: transform 0.2s ease;
}

.delete-btn:hover {
    transform: scale(1.2);
}

.daily-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background-color: rgba(255, 255, 255, 0.98); 
    border: 1px solid rgba(23, 51, 71, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgb(0, 0, 0 / 0.15); 
}

.summary-card h3 .emoji {
    font-size: 1.8em;
    margin-right: 8px;
}

.emoji {
    font-family: 'Noto Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    font-size: 1.5em;
    margin-right: 5px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 51, 71, 0.9); 
    z-index: 1000; 
    justify-content: center;
    align-items: center;
}

#paymentTypeModal {
    z-index: 2000;
}

.modal-content {
    position: relative;
    z-index: 1001;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0, 0, 0 / 0.1);
    width: calc(90% - 40px);
    max-width: 1200px; 
    height: 90vh;
    max-height: 900px;
    margin: auto;
    padding: 20px;
    overflow: auto;
    box-sizing: border-box;
    padding-top: 40px; 
}

#paymentTypeModal .modal-content {
    max-width: 400px;
    height: auto;
    max-height: 400px;
    z-index: 2001;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background-color: var(--danger-color);
    color: white;
}

.modal-btn-cancel {
    background-color: #95a5a6;
    color: white;
}

.payment-type-selector {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--primary-color);
}

.payment-type-selector h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.payment-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.payment-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.payment-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

.payment-btn.selected {
    background: var(--success-color);
    font-weight: bold;
}

#selectedPayment {
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin: 0;
    font-size: 0.9em;
    color: var(--text-color);
    border: 1px solid #e2e8f0;
}

.table-management {
    display: flex;
    gap: 25px;
    flex-direction: row;
    height: auto;
    min-height: 500px;
    margin: 0;
    padding: 10px;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

.order-section {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
}

.menu-section {
    flex: 2;
    max-width: calc(100% - 320px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-right: 15px; 
    overflow-x: hidden; 
    background: rgba(255, 255, 255, 0.98); 
    border-radius: 12px;
    padding: 15px;
}

.menu-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 0;
    background: rgba(240, 242, 245, 0.98); 
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-box {
    width: calc(100% - 24px); 
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    outline: none;
    position: relative;
    z-index: 1000;
    background: #f8f9fa; 
    box-sizing: border-box; 
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1); 
    padding: 10px;
    border-radius: 8px;
}

.category-filter {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.category-filter:hover {
    transform: translateY(-2px);
    background: var(--hover-color);
}

.category-filter.active {
    background: var(--success-color);
    font-weight: bold;
}

.category-filter:first-child {
    background: var(--primary-color);
}

.category-filter:first-child.active {
    background: var(--success-color);
}

.category-section {
  margin-bottom: 20px;
}

.category-section h4 {
  color: var(--primary-color);
  margin: 10px 0;
  padding: 5px;
  border-bottom: 1px solid var(--primary-color);
  font-size: 1.1em;
  font-weight: 600;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 10px;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    flex: 1;
    min-height: 500px; /* Increased from 400px */
    max-height: calc(100vh - 250px); /* Adjusted from 300px */
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
}

.product-item {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    margin-bottom: 4px;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-item-content {
    flex: 1;
    margin-right: 8px;
}

.menu-item {
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 150px;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-color: var(--success-color);
}

.menu-item .item-name {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    padding: 3px;
    border-bottom: 1px solid #e2e8f0;
}

.menu-item .stock-info {
    font-size: 0.8em;
    text-align: center;
    padding: 2px;
    background: #f8fafc;
    border-radius: 4px;
}

.menu-item .item-price {
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    color: var(--success-color);
    padding: 2px;
}

.product-comment {
    width: calc(100% - 10px);
    margin-top: 5px;
    padding: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.9em;
    resize: vertical;
    min-height: 20px; /* Reduced from 40px */
    max-height: 60px; /* Added max-height */
    background-color: white;
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    line-height: 1.2; /* Added for better text display */
}

.product-comment:hover, 
.product-comment:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Add these print-specific styles */
@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }

  body {
    width: 80mm;
    margin: 0;
    padding: 4mm;
    font-size: 9pt;
    line-height: 1.2;
  }
}

.table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Add these styles for daily records */
.records-section {
  margin-top: 25px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgb(0, 0, 0 / 0.1);
}

.records-section h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.record-item {
  background: white;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.record-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.record-details {
  flex: 1;
  margin-right: 15px;
}

.record-details div {
  margin: 5px 0;
}

.records-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.records-actions .btn {
    min-width: 200px;
}

#dailyRecords {
    margin-top: 10px;
}

/* New styles from the plan */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1002;
}

.modal-close-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.remove-product-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.remove-product-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.custom-notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
    font-size: 1.1em;
    max-width: 300px;
}

.custom-notification.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#stockWarningModal .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

#stockWarningModal p {
    text-align: center;
    margin: 10px 0;
    font-size: 1.1em;
}

#stockWarningModal .modal-buttons {
    margin-top: 20px;
}

.record-delete-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
}

.record-delete-btn:hover {
  transform: scale(1.1);
  background: #dc2626;
}

.update-record-item-styles {
  background: white;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.update-record-item-styles:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.record-details {
  flex: 1;
  margin-right: 15px;
}

.record-details div {
  margin: 5px 0;
}

.record-summary {
  margin-top: 10px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.9em;
}

.record-summary div {
  margin: 3px 0;
  color: var(--primary-color);
}

.partial-quantity-select {
    margin: 0 10px;
    padding: 2px 5px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
}

.partial-quantity-select:focus {
    outline: none;
    border-color: var(--success-color);
}

.btn-settings {
  position: absolute;
  top: 20px;
  right: 80px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}

.btn-settings:hover {
  background: var(--hover-color);
  transform: scale(1.1);
}

.establishment-settings {
  margin-top: 20px;
}

.server-input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
}

.server-info {
    margin: 10px 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9em;
}

.settings-input {
    width: 100%;
    padding: 8px;
    margin: 5px 0 15px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: 500;
}

.modal-content p {
    margin: 15px 0;
    text-align: center;
    font-size: 1.1em;
}

#passwordInput {
    margin: 15px 0;
    text-align: center;
    position: relative;
    z-index: 1100;
}

#passwordInput .settings-input {
    width: 80%;
    margin: 10px auto;
    padding: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 16px;
}

#passwordInput .settings-input:focus {
    outline: none;
    border-color: var(--success-color);
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}

.records-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.records-actions .btn {
    min-width: 200px;
}

.btn-control-panel {
    position: absolute; 
    top: 65px;  
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-control-panel:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

.license-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.license-content {
    background: var(--primary-color);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    color: white;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s ease-out;
}

.license-content h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.license-content p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.license-warning {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 12px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.5s ease-out;
    z-index: 9999;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}