@font-face {
	font-family: IRANSans;
	font-style: normal;
	font-weight: normal;
	src: url('https://hamidrezarazavi.com/pa-fa/fonts/eot/IRANSansWeb.eot');
	src: url('https://hamidrezarazavi.com/pa-fa/fonts/eot/IRANSansWeb.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
			url('https://hamidrezarazavi.com/pa-fa/fonts/woff2/IRANSansWeb.woff2') format('woff2'),  /* FF39+,Chrome36+, Opera24+*/
			url('https://hamidrezarazavi.com/pa-fa/fonts/woff/IRANSansWeb.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
			url('https://hamidrezarazavi.com/pa-fa/fonts/ttf/IRANSansWeb.ttf') format('truetype');
}

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --container-bg: #ffffff;
  --container-shadow: rgba(0, 0, 0, 0.1);
}

.dark-mode {
  --bg-color: #121212;
  --text-color: #ffffff;
  --container-bg: #242424; /*#1e1e1e*/
  --container-shadow: #bdbdbd;
}

body {
  font-family: IRANSans !important;
  font-weight: normal;  
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  direction: rtl;
  text-align: right;
}

h1, h2, h3, h4, h5, h6, a, input, textarea {
	font-family: IRANSans !important;
}

.container {
  font-family: IRANSans !important;	
  max-width: 800px;
  margin: auto;
  padding: 35px;
  background: var(--container-bg);
  border-radius: 8px;
  box-shadow: 0 0 10px var(--container-shadow);
  transition: background-color 0.3s, box-shadow 0.3s;
}

h1, h2, a {
  text-align: center;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* table style */
table {
  font-family: IRANSans !important;	
  border-spacing: 1;
  border-collapse: collapse;
  background: var(--container-bg);
  border-radius: 6px;
  overflow: hidden;
  width: 100%; /* Ensure the table takes up 100% of the parent width */
  max-width: 800px; /* Limit the maximum width */
  margin: 5px auto;
  box-sizing: border-box; /* Include padding and borders in the width */
  position: relative;
  margin-top: 20px;
}

table td, table th {
  padding-left: 6px;
  box-sizing: border-box;
}

thead tr {
  height: 60px;
  background: #70b5ff;
  color: var(--text-color);
  font-size: 16px;
}

tbody tr {
  height: 48px;
  border-bottom: 1px solid #E3F1D5;
}

tbody tr:last-child {
  border: 0;
}

td, th {
  text-align: right;
}

td.l {
  text-align: right;
}

td.c, th.c {
  text-align: center;
}

td.r, th.r {
  text-align: center;
}

.print-button {
  background-color: #4CAF50;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin: 15px 0;
  width: 100%;
  transition: background-color 0.3s;
  font-family: IRANSans !important;
}

.print-button:hover {
  background-color: #45a049;
}

/* Tabs styling */
.tabs {
  font-family: IRANSans !important;	
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.tab-link {
  font-family: IRANSans !important;	
  padding: 10px 20px;
  cursor: pointer;
  background-color: #ddd;
  border: none;
  border-radius: 5px;
}

.tab-link.active {
  font-family: IRANSans !important;	
  background-color: #007BFF;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.button1 {
  font-family: IRANSans !important;	
  padding: 20px 10px;
  cursor: pointer;
  background-color: green;
  color: white;
  border: none;
  border-radius: 5px;
  margin-top: 20px;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}

.button2 {
  font-family: IRANSans !important;	
  padding: 20px 10px;
  cursor: pointer;
  background-color: red;
  color: white;
  border: none;
  border-radius: 5px;
  margin-top: 20px;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}

input[type=text] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  box-sizing: border-box;
  border: none;
  border-bottom: 2px solid gray;
  border-radius: 4px;
}

input[type=number] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  box-sizing: border-box;
  border: none;
  border-bottom: 2px solid gray;
  border-radius: 4px;
}

input[type=date] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  box-sizing: border-box;
  border: none;
  border-bottom: 2px solid gray;
  border-radius: 4px;
}

select {
  font-family: IRANSans !important;	
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  box-sizing: border-box;
  border: none;
  border-bottom: 2px solid gray;
  border-radius: 4px;
}

#duration-fields {
    margin-top: 10px;
}

#duration-fields input,
#duration-fields button {
    margin-right: 5px;
}

.pointer {cursor: pointer;}

/* Switch button */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

.login-button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: IRANSans !important;
}

.login-button:hover {
  background-color: #0056b3;
}

#username-display {
  font-weight: bold;
  color: #4CAF50; /* Green color for the username */
}

/* Media query for vertical mobile view */
/* Modified media queries section - merged properly */
@media (max-width: 768px) {
  table {
    width: 70%;
    margin: 0 auto;
    padding: 0;
  }
  thead tr {
    height: 60px;
    background: var(--container-bg);
    font-size: 14px;
  }
  td, th {
    padding-left: 1px;
  }
}

@media print {
  /* Keep existing print styles and add chart adjustments */
    /* Set page size to A3 */
  @page {
    size: A3;
    margin: 15mm; /* Optional: adjust margins */
  }
  body > *:not(.container),
  .top-bar, 
  .tabs,
  #income-form,
  #cost-form,
  h3,
  a, 
  button:not(.print-button) {
    display: none !important;
  }
  
  /* Show only active tab content */
  .tab-content:not(.active) {
    display: none !important;
  }
  
  /* Style tables for printing */
  table {
    width: 100% !important;
    font-size: 14pt !important;
    page-break-inside: auto !important;
  }
  
  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }
  
  table th:nth-child(4),
  table td:nth-child(4) {
    display: none !important;
  }
  
  /* Add these to improve print layout */
  .container {
    box-shadow: none;
    padding: 10px !important;
    width: 80% !important;
    max-width: 42cm !important; /* A3 width in cm */
  }
  
  /* Hide print button in actual print */
  .print-button {
    display: none !important;
  }
}

/* Add these new styles at the end of your CSS */
a[href="https://hamidrezarazavi.com"] {
  display: block;
  text-align: center;
  padding: 10px;
  margin: 10px auto 0;
  color: #666;
  text-decoration: none;
  /* width: 100%;
  max-width: 500px; /* Match container max-width */
}