:root{
  --color1:#FF3F33;
  --color2:rgb(67, 112, 136);
  --color3:#075B5E;
  --color4:#9FC87E;
}

*{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  direction: rtl; /* Passage à droite à gauche */
  text-align: right; /* Texte aligné à droite */
}
    
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.outcontent{
  max-width: 1100px;
  margin: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: row-reverse; /* inversion pour RTL */
}

.left-content{
  width: 70%;
  padding-left: 20px; /* Remplace padding-right */
}

h1 {
  color: var(--color3);
  text-transform: capitalize;
  padding-bottom: 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color4);
  max-width: 650px;
  text-align: right;
}

.container {
  background: white;
  padding: 30px 60px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  text-align: center;
  outline: 2px solid var(--color3);
  margin-top: 20px;
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

label {
  font-weight: 600;
  min-width: 120px;
  text-align: right;
  color: var(--color3);
  user-select: none;
}

input[type="number"], input[readonly] {
  flex: 1 1 180px;
  font-size: 1.2em;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1.5px solid var(--color3);
  transition: border-color 0.3s;
  text-align: right; /* Texte aligné à droite pour RTL */
  min-width: 150px;
  outline: none;
}

input[type="number"]:focus {
  border-color: rgb(0, 204, 88);
}

input[readonly] {
  background: #e6ebff;
  border-color: #a8b8ff;
}

button {
  margin-top: 10px;
  background-color: var(--color3);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  user-select: none;
  transition: background-color 0.3s;
}
button:hover {
  background-color: var(--color4);
}

.buttons-row {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.result {
  margin-top: 25px;
  font-size: 1.1em;
  color: #444;
  text-align: right;
}

.formula {
  margin-top: 10px;
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  max-height: 200px;
  overflow-wrap: break-word;
  user-select: text;
  display: none; /* caché par défaut */
  text-align: right;
}

@media (max-width: 480px) {
  .input-group {
    flex-direction: column;
    align-items: stretch;
  }
  label {
    text-align: right;
    min-width: auto;
    margin-bottom: 6px;
  }
}

.conversion-method {
  background: #f3fbff;
  margin-top: 50px;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 15px;
}

h2 {
  color: var(--color3);
  padding-bottom: 10px;
  padding-right: 10px; /* inversé pour RTL */
  border-right: 10px solid var(--color3); /* inversé pour RTL */
  text-transform: capitalize;
  margin-top: 20px;
  margin-bottom: 20px;
  text-align: right;
}

.conversion-method h3 {
  color: rgb(0, 141, 73);
  margin-top: 20px;
}

.formula {
  background: #e8f4fc;
  padding: 10px;
  border-right: 4px solid #3498db; /* inversé pour RTL */
  font-family: monospace;
  font-size: 1.1em;
}

.example {
  background: #e8f8f0;
  padding: 10px;
  border-right: 4px solid #2ecc71; /* inversé pour RTL */
  font-family: monospace;
}

.method-steps ol {
  padding-right: 20px; /* inversé pour RTL */
}

.method-steps li {
  margin-bottom: 10px;
}

.conversion-table {
  margin: 50px 0;
  font-family: Arial, sans-serif;
}

.conversion-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.conversion-table th, .conversion-table td {
  padding: 8px 12px;
  border: 1px solid var(--color4);
  text-align: right; /* RTL */
}

.conversion-table th {
  background-color: var(--color4);
}

.conversion-table tr:nth-child(even) {
  background-color: rgb(236, 255, 244);
}

.more-conversions{
  width: 100%;
  display: inline-flex;
  flex-wrap: wrap;
}
.more-conversions .links{
  list-style-type: none;
}
.more-conversions .links li{
  background-color: rgb(67, 112, 136);
  padding: 6px;
  border-radius: 5px;
  margin: 5px;
  float: right; /* inversé pour RTL */
}
.more-conversions a{
  text-decoration: none;
  color: white;
  font-weight: 400;
}
.more-conversions a:hover{
  text-decoration: underline;
  color: var(--color3);
  transition: 0.3s;
}

.popular-conversions{
  width: 100%;
  list-style-type: none;
  flex-wrap: wrap;
}
.popular-conversions li{
  background-color: var(--color3);
  padding: 6px;
  border-radius: 5px;
  margin: 5px;
  float: right; /* inversé pour RTL */
}
.popular-conversions a{
  text-decoration: none;
  color: white;
  font-weight: 400;
}

@media (max-width: 1100px){
  .left-content{
    width: 100%;
    padding: 20px;
  }
  .right-content{
    display: none;
  }
  h1, .pre-calc-p{
    text-align: center;
    margin: auto;
    width: 100%;
  }
  h2{
    margin-right: 0; /* inversé margin-left */
  }
  .conversion-method{
    padding: 0;
  }
  .container{
    margin: auto;
    margin-top: 20px;
  }
}

@media (max-width: 600px){
  .left-content{
    padding: 5px;
  }
  .container{
    width: 98%;
    padding: 10px;
  }
  .container .input-group{
    width: 100%;
    display: block;
    padding: 0;
    margin: 0 0 30px 0;
  }
  .input-group input{
    width: 100%;
    margin-top: 6px;
  }
}

