@font-face {
    font-family: 'DevGothic';
    src: url('/fonts/devgothic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improve font loading performance */
}

/* Theme Variables */
:root {
    --bg-dark: #000;
    --bg-light: #fff;
    --text-dark: #fff;
    --text-light: #000;
    --accent-dark: #0d977e;
    --accent-light: #0a6e59;
    --secondary-dark: #222;
    --secondary-light: #ddd;
    --tertiary-dark: #333;
    --tertiary-light: #ccc;
}

* {
    box-sizing: border-box;
}

body.dark-mode {
    font-family: 'DevGothic', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

body.light-mode {
    font-family: 'DevGothic', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light);
}

header {
    text-align: center;
    padding: 10px;
}

.logo {
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 50px;
}

h1 {
    font-size: 2em;
    margin: 10px 0;
    color: var(--accent-dark);
}

body.light-mode h1 {
    color: var(--accent-light);
}

html {
    font-size: 18px;
}

body.dark-mode, body.light-mode {
    font-family: 'DevGothic', Arial, sans-serif;
    font-size: 1.75rem;
}

nav {
    width: 95%;
    margin: 0 auto;
    padding: 10px 0;
    background-color: transparent;
}

body.light-mode nav {
    background-color: transparent;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

nav ul li {
    flex: 1;
    margin: 0;
    position: relative;
}

nav ul li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 60px;
    border: 3px solid var(--text-dark);
    border-radius: 0;
    background-color: var(--secondary-dark);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.3s ease, font-weight 0.3s ease;
}

body.light-mode nav ul li a {
    border: 3px solid var(--text-light);
    background-color: var(--secondary-light);
    color: var(--text-light);
}

nav ul li a:hover, nav ul li a:focus {
    background-color: #333;
    font-weight: bold;
    color: var(--accent-dark);
}

body.light-mode nav ul li a:hover, body.light-mode nav ul li a:focus {
    background-color: #ccc;
    color: var(--accent-light);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1;
}

.dropdown-content li {
    margin: 5px 0;
}

.dropdown-content li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    border: 3px solid var(--text-dark);
    border-radius: 0;
    background-color: var(--secondary-dark);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.8em;
    transition: background-color 0.3s ease, font-weight 0.3s ease;
}

body.light-mode .dropdown-content li a {
    border: 3px solid var(--text-light);
    background-color: var(--secondary-light);
    color: var(--text-light);
}

.dropdown-content li a:hover, .dropdown-content li a:focus {
    background-color: #333;
    font-weight: bold;
    color: var(--accent-dark);
}

body.light-mode .dropdown-content li a:hover, body.light-mode .dropdown-content li a:focus {
    background-color: #ccc;
    color: var(--accent-light);
}

.dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content {
    display: block;
}

.submenu {
    position: relative;
}

.submenu-content {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    background-color: transparent;
    z-index: 2;
}

.submenu-content li {
    margin: 5px 0;
}

.submenu-content li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    border: 3px solid var(--text-dark);
    border-radius: 0;
    background-color: var(--secondary-dark);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.8em;
    transition: background-color 0.3s ease, font-weight 0.3s ease;
}

body.light-mode .submenu-content li a {
    border: 3px solid var(--text-light);
    background-color: var(--secondary-light);
    color: var(--text-light);
}

.submenu-content li a:hover, .submenu-content li a:focus {
    background-color: #333;
    font-weight: bold;
    color: var(--accent-dark);
}

body.light-mode .submenu-content li a:hover, body.light-mode .submenu-content li a:focus {
    background-color: #ccc;
    color: var(--accent-light);
}

.submenu:hover .submenu-content, .submenu:focus-within .submenu-content {
    display: block;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 95%;
    margin: 2vh auto;
    border: 3px solid #000;
    background-color: #1a1a1a;
    box-sizing: border-box;
    min-height: 0;
}

body.light-mode main {
    border: 3px solid #ccc;
    background-color: var(--bg-light);
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    padding: 10px 0;
    width: 100%;
    background-color: var(--secondary-dark);
}

body.light-mode .header-grid {
    background-color: var(--secondary-light);
}

.market-snapshot {
    text-align: center;
    color: var(--accent-dark);
    margin: 0 auto;
    padding: 5px 10px;
}

body.light-mode .market-snapshot {
    color: var(--accent-light);
}

.calculator-heading-placeholder {
    grid-column: 2 / 3;
}

.market-data-heading {
    grid-column: 1 / 2;
    text-align: center;
    font-size: 1.5em;
    color: var(--accent-dark);
    margin: 0;
}

body.light-mode .market-data-heading {
    color: var(--accent-light);
}

.calculator-heading {
    grid-column: 2 / 3;
    text-align: center;
    font-size: 1.5em;
    color: var(--accent-dark);
    margin: 0;
}

body.light-mode .calculator-heading {
    color: var(--accent-light);
}

.theme-toggle-container {
    width: 95%;
    margin: 0 auto;
    text-align: right;
    padding: 5px 0;
}

#theme-toggle {
    cursor: pointer;
    max-width: 50px;
    max-height: 50px;
    transition: opacity 0.3s ease;
}

#theme-toggle:hover {
    opacity: 0.8;
}

.charts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto; /* Let rows size dynamically */
    gap: 5px;
    width: 100%;
    min-height: 80vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
    flex: 3;
    background-color: var(--secondary-dark);
}

body.light-mode .charts {
    background-color: var(--secondary-light);
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.chart-title {
    font-size: 1.2em;
    color: #fff; /* White text for all themes */
    margin: 5px 0;
    text-align: center;
    width: 100%;
}

.chart {
    background-color: var(--secondary-dark);
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
}

body.light-mode .chart {
    background-color: var(--secondary-light);
}

.chart .tradingview-widget-container {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.chart .tradingview-widget-container > div {
    width: 100% !important;
    height: 100% !important;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-dark);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    z-index: 10;
}

body.light-mode .loader {
    border: 4px solid #ccc;
    border-top: 4px solid var(--accent-light);
}

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

.world-clocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 20px;
    box-sizing: border-box;
    flex: 0 1 auto;
    background-color: var(--secondary-dark);
    width: 100%;
}

body.light-mode .world-clocks {
    background-color: var(--secondary-light);
}

.clock {
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
}

body.light-mode .clock {
    background-color: var(--bg-light);
}

.clock-name {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.clock-time {
    font-size: 1em;
}

.crypto-ticker {
    margin: 20px 0;
    padding: 10px;
    white-space: nowrap;
    overflow: hidden; /* No scrollbar */
    max-width: 100%; /* Fit within page */
}

body.light-mode .crypto-ticker {
    border: 1px solid var(--tertiary-light);
    background-color: var(--secondary-light);
}

#ticker {
    display: flex;
    flex-direction: row; /* Explicitly horizontal */
    flex-wrap: nowrap; /* Prevent wrapping */
    align-items: center;
    animation: ticker-slide 30s linear infinite; /* Smooth scrolling */
    width: max-content; /* Allow content to extend for animation */
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    margin-right: 15px; /* Space between items */
    font-size: 0.9em; /* Adjust for fit */
    flex-shrink: 0; /* Prevent squeezing */
}

.ticker-item .symbol {
    font-weight: bold;
    margin-right: 5px;
}

.ticker-item .price {
    margin-right: 5px;
}

.ticker-item .change {
    font-size: 0.9em;
}

@keyframes ticker-slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.calculator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 0px 20px;
    box-sizing: border-box;
    flex: 0 1 auto;
    width: 100%;
    background-color: var(--tertiary-dark);
}

body.light-mode .calculator {
    background-color: var(--tertiary-light);
}

.calculator h1 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.converter-container {
    display: grid;
    grid-template-columns: 1fr 50px 1fr 50px 1fr;
    grid-template-rows: auto auto auto;
    width: 100%;
    background-color: var(--tertiary-dark);
    padding: 20px 0;
    box-sizing: border-box;
    gap: 5px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

body.light-mode .converter-container {
    background-color: var(--tertiary-light);
}

.converter-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.converter-header {
    color: #999;
    font-size: 1.2em;
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

body.light-mode .converter-header {
    color: #000;
}

.converter-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 50px;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.converter-column select,
.converter-column input {
    height: 100%;
    font-size: 20px;
    padding: 5px;
    margin: 0;
    box-sizing: border-box;
    background-color: var(--secondary-dark);
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    border-radius: 0;
    overflow-x: auto !important;
    white-space: nowrap;
    flex-grow: 1;
}

body.light-mode .converter-column select,
body.light-mode .converter-column input {
    background-color: var(--bg-light);
    color: #000;
    border: 2px solid var(--text-light);
}

.converter-column input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.converter-column input[type="number"]::-webkit-inner-spin-button,
.converter-column input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.converter-column select:focus,
.converter-column input:focus {
    border-radius: 0;
    outline: 2px solid var(--accent-dark);
}

body.light-mode .converter-column select:focus,
body.light-mode .converter-column input:focus {
    outline: 2px solid var(--accent-light);
}

.converter-column:nth-child(3) .converter-inputs input {
    width: 100%;
    flex-grow: 1;
}

.converter-column:nth-child(1) .converter-inputs,
.converter-column:nth-child(5) .converter-inputs {
    display: flex;
    justify-content: center;
    width: 100%;
}

.converter-column:nth-child(1) select,
.converter-column:nth-child(5) select {
    width: 20%;
    flex-grow: 0;
    margin-right: 0;
    border-right: none;
}

.converter-column:nth-child(1) input,
.converter-column:nth-child(5) input {
    width: 80%;
    flex-grow: 0;
    margin-left: 0;
}

.converter-equals-column {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 50px;
    padding: 0 10px;
}

.converter-equals {
    color: #999;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    line-height: 50px;
}

body.light-mode .converter-equals {
    color: #000;
}

.converter-exchanges {
    grid-column: 1 / 6;
    grid-row: 3 / 4;
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    background-color: var(--tertiary-dark);
    box-sizing: border-box;
}

body.light-mode .converter-exchanges {
    background-color: var(--tertiary-light);
}

.converter-exchanges ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.converter-exchanges li {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-dark);
    padding: 5px 10px;
    border: 3px solid #999;
    border-radius: 0;
    font-size: 1em;
    color: #999;
    cursor: pointer;
}

body.light-mode .converter-exchanges li {
    background-color: var(--bg-light);
    border: 3px solid #666;
    color: #666;
}

.converter-exchanges li:hover, .converter-exchanges li:focus {
    background-color: #111;
    border: 3px solid var(--accent-dark);
    color: var(--accent-dark);
    font-weight: bold;
}

body.light-mode .converter-exchanges li:hover, body.light-mode .converter-exchanges li:focus {
    background-color: #ccc;
    border: 3px solid var(--accent-light);
    color: var(--accent-light);
}

.converter-exchanges a {
    text-decoration: none;
    color: inherit;
}

/* Specific styles for crypto.php converter */
body.crypto-page .crypto-converter-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    width: 100%;
    min-width: 0;
    padding: 0 20px;
    box-sizing: border-box;
    gap: 0;
    align-items: center;
    background: transparent;
    margin: 0;
    max-width: 100%;
}

body.light-mode body.crypto-page .crypto-converter-container {
    background: transparent;
}

body.crypto-page .crypto-converter-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: hidden;
    min-height: 0;
    width: 100%;
}

body.crypto-page .crypto-converter-header {
    color: #999;
    font-size: 1.2em;
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

body.light-mode body.crypto-page .crypto-converter-header {
    color: #000;
}

body.crypto-page .crypto-converter-inputs {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 50px;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

body.crypto-page .crypto-converter-column.crypto-amount .crypto-converter-inputs input {
    width: 100%;
    box-sizing: border-box;
    height: 100%;
}

body.crypto-page .crypto-converter-column.crypto-value .crypto-converter-inputs input {
    width: 80%;
    box-sizing: border-box;
    height: 100%;
    margin-right: 0;
    border-right: none;
}

body.crypto-page .crypto-converter-column.crypto-value .crypto-converter-inputs select {
    width: 20%;
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

body.crypto-page .crypto-converter-column select,
body.crypto-page .crypto-converter-column input {
    height: 100%;
    font-size: 20px;
    padding: 5px;
    margin: 0;
    box-sizing: border-box;
    background-color: var(--secondary-dark);
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    border-radius: 0;
    overflow-x: auto !important;
    white-space: nowrap;
}

body.light-mode body.crypto-page .crypto-converter-column select,
body.light-mode body.crypto-page .crypto-converter-column input {
    background-color: var(--bg-light);
    color: #000;
    border: 2px solid var(--text-light);
}

body.crypto-page .crypto-converter-column input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

body.crypto-page .crypto-converter-column input[type="number"]::-webkit-inner-spin-button,
body.crypto-page .crypto-converter-column input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.crypto-page .crypto-converter-column select:focus,
body.crypto-page .crypto-converter-column input:focus {
    border-radius: 0;
    outline: 2px solid var(--accent-dark);
}

body.light-mode body.crypto-page .crypto-converter-column select:focus,
body.light-mode body.crypto-page .crypto-converter-column input:focus {
    outline: 2px solid var(--accent-light);
}

body.crypto-page .crypto-converter-equals-column {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    padding: 0 10px;
    margin: 0;
}

body.crypto-page .crypto-converter-equals {
    color: #999;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    line-height: 50px;
}

body.light-mode body.crypto-page .crypto-converter-equals {
    color: #000;
}

.price-value {
    color: var(--accent-dark);
}

body.light-mode .price-value {
    color: var(--accent-light);
}

.news {
    padding: 20px;
    box-sizing: border-box;
    flex: 0 1 auto;
    background-color: var(--secondary-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body.light-mode .news {
    background-color: var(--secondary-light);
}

.news h1 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.news-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.news-left {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--tertiary-dark);
    padding: 10px;
    box-sizing: border-box;
}

body.light-mode .news-left {
    background-color: var(--tertiary-light);
}

.news-left h2 {
    color: var(--accent-dark);
    margin: 0;
}

body.light-mode .news-left h2 {
    color: var(--accent-light);
}

.news-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--tertiary-dark);
    padding: 10px;
    box-sizing: border-box;
    align-items: center;
}

body.light-mode .news-right {
    background-color: var(--tertiary-light);
}

.news-feed-heading {
    font-size: 1.5em;
    color: var(--accent-dark);
    margin: 0 0 10px 0;
    text-align: center;
    width: 100%;
}

body.light-mode .news-feed-heading {
    color: var(--accent-light);
}

.news-right a {
    color: var(--accent-dark);
    text-decoration: none;
    margin-top: 10px;
}

body.light-mode .news-right a {
    color: var(--accent-light);
}

#news-feed {
    width: 100%;
    position: relative;
}

.news-item {
    background-color: var(--secondary-dark);
    padding: 15px;
    margin-bottom: 10px;
    border: 3px solid var(--text-dark);
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

body.light-mode .news-item {
    background-color: var(--bg-light);
    border: 3px solid var(--text-light);
}

.news-item:hover, .news-item:focus {
    background-color: #111;
    border: 3px solid var(--accent-dark);
    color: var(--accent-dark);
    font-weight: bold;
}

body.light-mode .news-item:hover, body.light-mode .news-item:focus {
    background-color: #ccc;
    border: 3px solid var(--accent-light);
    color: var(--accent-light);
}

.news-item h3 {
    margin: 0 0 5px 0;
    font-size: 1em;
    color: var(--text-dark);
}

body.light-mode .news-item h3 {
    color: var(--text-light);
}

.news-item:hover h3, .news-item:focus h3 {
    color: var(--accent-dark);
}

body.light-mode .news-item:hover h3, body.light-mode .news-item:focus h3 {
    color: var(--accent-light);
}

.news-item h3 a {
    color: inherit;
    text-decoration: none;
}

.news-item h3 a:hover, .news-item h3 a:focus {
    text-decoration: underline;
}

.news-item p {
    margin: 0 0 5px 0;
    font-size: 0.75em;
    color: #999;
}

body.light-mode .news-item p {
    color: #666;
}

.news-item small {
    color: var(--text-dark);
    font-size: 0.65em;
}

body.light-mode .news-item small {
    color: var(--text-light);
}

.news-item small a {
    color: inherit;
    text-decoration: none;
}

.news-item small a:hover, .news-item small a:focus {
    text-decoration: underline;
}

.crypto-data {
    display: flex;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background-color: var(--secondary-dark);
    align-items: stretch;
}

body.light-mode .crypto-data {
    background-color: var(--secondary-light);
}

.crypto-chart {
    width: 65%;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.crypto-side {
    width: 35%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    box-sizing: border-box;
    background-color: var(--tertiary-dark);
    max-width: 35%;
}

body.light-mode .crypto-side {
    background-color: var(--tertiary-light);
}

.current-price {
    width: 100%;
    padding: 10px 0;
    margin: 0 0 10px 0;
    background-color: var(--tertiary-dark);
    font-size: 1.5em;
    text-align: center;
    box-sizing: border-box;
}

body.light-mode .current-price {
    background-color: var(--tertiary-light);
}

.current-price .price-value {
    color: var(--accent-dark);
}

body.light-mode .current-price .price-value {
    color: var(--accent-light);
}

footer {
    width: 95%;
    margin: 2vh auto 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--text-dark);
}

body.light-mode footer {
    color: var(--text-light);
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.footer-column {
    flex: 1;
    padding: 0 10px;
}

.footer-column h3 {
    font-size: 1.2em;
    color: var(--accent-dark);
    margin-bottom: 10px;
    text-align: center;
}

body.light-mode .footer-column h3 {
    color: var(--accent-light);
}

.footer-column p {
    font-size: 0.9em;
    margin: 5px 0;
    text-align: left;
}

.footer-column a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

body.light-mode .footer-column a {
    color: var(--text-light);
}

.footer-column a:hover, .footer-column a:focus {
    color: var(--accent-dark);
}

body.light-mode .footer-column a:hover, body.light-mode .footer-column a:focus {
    color: var(--accent-light);
}

.social-icons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.social-icons a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.social-icons img {
    width: 50px;
    height: 50px;
    transition: opacity 0.3s ease;
}

.social-icons img:hover {
    opacity: 0.8;
}

.footer-copyright {
    width: 100%;
    text-align: center;
}

.footer-copyright p {
    font-size: 0.9em;
    margin: 0;
}

@media (max-width: 1600px) {
    .converter-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto auto;
        gap: 10px;
        min-width: 0;
    }
    .converter-header:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .converter-column:nth-child(2) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .converter-header:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    .converter-equals-column:nth-child(4) {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }
    .converter-column:nth-child(5) {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }
    .converter-header:nth-child(6) {
        grid-column: 1 / 2;
        grid-row: 6 / 7;
    }
    .converter-exchanges {
        grid-column: 1 / 2;
        grid-row: 7 / 8;
    }
    .converter-inputs {
        width: 100% !important;
        max-width: 510px;
        justify-content: flex-start;
    }
    .converter-equals-column {
        width: 100%;
        text-align: center;
    }
    body.crypto-page .crypto-converter-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        max-width: 100%;
    }
    body.crypto-page .crypto-converter-header:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    body.crypto-page .crypto-converter-column.crypto-amount {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    body.crypto-page .crypto-converter-header:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    body.crypto-page .crypto-converter-equals-column {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }
    body.crypto-page .crypto-converter-column.crypto-value {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }
}

@media (max-width: 768px) {
    main {
        width: 90%;
        margin: 2vh auto;
    }
    nav {
        width: 90%;
        margin: 0 auto;
    }
    .charts {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        min-height: 50vh;
    }
    .world-clocks {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    .calculator {
        width: 100%;
        padding: 20px 0;
    }
    .converter-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto auto;
        gap: 10px;
        padding: 10px 0;
    }
    .converter-header:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .converter-column:nth-child(2) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .converter-header:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    .converter-equals-column:nth-child(4) {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }
    .converter-column:nth-child(5) {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }
    .converter-header:nth-child(6) {
        grid-column: 1 / 2;
        grid-row: 6 / 7;
    }
    .converter-exchanges {
        grid-column: 1 / 2;
        grid-row: 7 / 8;
    }
    .converter-inputs {
        width: 100% !important;
        max-width: 510px;
        justify-content: flex-start;
    }
    .converter-column select,
    .converter-column input {
        width: 100%;
        margin: 0;
        border: 2px solid var(--text-dark);
    }
    body.light-mode .converter-column select,
    body.light-mode .converter-column input {
        border: 2px solid var(--text-light);
    }
    .converter-equals-column {
        width: 100%;
        text-align: center;
        padding: 0;
    }
    nav ul {
        flex-wrap: wrap;
        gap: 5px;
    }
    nav ul li {
        flex: 1 1 calc(50% - 5px);
    }
    .news-columns {
        grid-template-columns: 1fr;
    }
    .crypto-data {
        flex-direction: column;
    }
    .crypto-chart, .crypto-side {
        width: 100%;
        padding: 0;
        max-width: 100%;
    }
    .crypto-chart .chart {
        height: auto;
    }
    .header-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .market-snapshot, .market-data-heading, .calculator-heading {
        grid-column: 1 / 2;
    }
    .theme-toggle-container {
        width: 90%;
        text-align: center;
        padding: 5px 0;
    }
    .crypto-side {
        padding: 0;
    }
    body.crypto-page .crypto-converter-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 10px 0;
        width: 100%;
        max-width: 100%;
    }
    body.crypto-page .crypto-converter-header:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    body.crypto-page .crypto-converter-column.crypto-amount {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    body.crypto-page .crypto-converter-header:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    body.crypto-page .crypto-converter-equals-column {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }
    body.crypto-page .crypto-converter-column.crypto-value {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }
    body.crypto-page .crypto-converter-column.crypto-amount .crypto-converter-inputs,
    body.crypto-page .crypto-converter-column.crypto-value .crypto-converter-inputs {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin-top: 0;
    }
    .chart-title {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    main {
        width: 85%;
        margin: 1vh auto;
    }
    nav {
        width: 85%;
        margin: 0 auto;
    }
    .charts {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: 40vh;
    }
    .calculator {
        width: 100%;
    }
    .converter-inputs {
        width: 100% !important;
        max-width: 200px;
    }
    nav ul {
        flex-direction: column;
        gap: 5px;
    }
    nav ul li {
        flex: 1 0 auto;
    }
    footer {
        width: 85%;
    }
    .theme-toggle-container {
        width: 85%;
    }
    .social-icons img {
        width: 40px;
        height: 40px;
    }
    .chart-title {
        font-size: 0.9em;
    }
}