@font-face {
    font-family: 'IRANSans';
    src: url('fonts/IRANSansWeb.eot');
    src: url('fonts/IRANSansWeb.eot?#iefix') format('embedded-opentype'),
         url('fonts/IRANSansWeb.woff2') format('woff2'),
         url('fonts/IRANSansWeb.woff') format('woff'),
         url('fonts/IRANSansWeb.ttf') format('truetype'),
         url('fonts/IRANSansWeb.svg#IRANSansWeb') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, body * {
    font-family: 'IRANSans', system-ui, -apple-system, Tahoma, sans-serif !important;
}

body {
    background: #f0f4f8;
    min-height: 100vh;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

body.dark-mode {
    background: #1a1a2e;
}

.glass-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 0 16px;
}

.glass-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 24px 24px 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

body.dark-mode .glass-card {
    background: #252540;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

body.dark-mode .header-card {
    background: #1e1e3a;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.menu-icon, .icon-btn {
    background: #e2e8f0;
    border: none;
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 24px;
    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .menu-icon, body.dark-mode .icon-btn {
    background: #334155;
    color: #f1f5f9;
}

.menu-icon:active, .icon-btn:active {
    transform: scale(0.95);
}

.logo-area {
    flex: 1;
    text-align: center;
}

.logo-area h1 {
    font-size: 1.3rem;
    margin: 0;
    color: #1e293b;
}

body.dark-mode .logo-area h1 {
    color: #f1f5f9;
}

.badge {
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.65rem;
    color: #3b82f6;
    font-weight: normal;
}

body.dark-mode .badge {
    background: #334155;
    color: #60a5fa;
}

.subtitle {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #64748b;
}

body.dark-mode .subtitle {
    color: #94a3b8;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 60px;
}

body.dark-mode .tabs {
    background: #1e1e3a;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 8px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.dark-mode .tab-btn {
    color: #94a3b8;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab-btn:active {
    transform: scale(0.97);
}

.row-fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.half {
    flex: 1;
    min-width: 130px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

body.dark-mode label {
    color: #cbd5e1;
}

.help-icon {
    display: inline-block;
    background: #e2e8f0;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    margin-right: 6px;
    color: #64748b;
    transition: all 0.2s;
}

body.dark-mode .help-icon {
    background: #334155;
    color: #94a3b8;
}

.help-icon:hover {
    background: #3b82f6;
    color: white;
}

.glass-input {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    color: #1e293b;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

body.dark-mode .glass-input {
    background: #1e1e3a;
    border-color: #334155;
    color: #f1f5f9;
}

.glass-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.glass-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

select.glass-input option {
    color: #1e293b;
}

body.dark-mode select.glass-input option {
    background: #1e1e3a;
    color: #f1f5f9;
}

.results-glass {
    background: #f8fafc;
    border-radius: 24px;
    padding: 16px;
    margin: 16px 0;
}

body.dark-mode .results-glass {
    background: #1e1e3a;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

body.dark-mode .result-item {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item span:first-child {
    font-size: 0.85rem;
    font-weight: 500;
}

.result-item span:nth-child(2) {
    background: white;
    padding: 4px 16px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

body.dark-mode .result-item span:nth-child(2) {
    background: #252540;
    color: #f1f5f9;
}

.highlight span:nth-child(2) {
    background: #3b82f6;
    color: white !important;
}

.action-buttons-bottom {
    display: flex;
    gap: 12px;
    margin: 8px 0 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.glass-btn-small {
    background: #e2e8f0;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .glass-btn-small {
    background: #334155;
    color: #f1f5f9;
}

.glass-btn-small:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.glass-btn-small:active {
    transform: scale(0.96);
}

.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.65rem;
    color: #94a3b8;
}

body.dark-mode .footer {
    color: #64748b;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: 0.3s ease-out;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode .side-menu {
    background: #1e1e3a;
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    color: #1e293b;
    font-size: 1.2rem;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .side-menu-header {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #64748b;
    transition: transform 0.2s;
}

body.dark-mode .close-menu {
    color: #94a3b8;
}

.close-menu:hover {
    transform: rotate(90deg);
}

.side-menu-items {
    list-style: none;
    margin-top: 30px;
    flex-grow: 1;
}

.side-menu-items li {
    margin: 15px 0;
}

.side-menu-items a {
    color: #475569;
    text-decoration: none;
    font-size: 1rem;
    display: block;
    padding: 10px 12px;
    transition: all 0.2s ease;
    border-radius: 16px;
}

body.dark-mode .side-menu-items a {
    color: #cbd5e1;
}

.side-menu-items a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

body.dark-mode .side-menu-items a:hover {
    background: #334155;
    color: white;
}

.side-menu-footer .credit {
    color: #94a3b8;
    font-size: 0.65rem;
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

body.dark-mode .side-menu-footer .credit {
    color: #64748b;
    border-top-color: #334155;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 280px;
    width: 90%;
    padding: 20px;
    text-align: center;
    position: relative;
}

.close-modal {
    float: left;
    font-size: 1.8rem;
    cursor: pointer;
    color: #64748b;
}

body.dark-mode .close-modal {
    color: #94a3b8;
}

.page-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #f0f4f8;
    z-index: 900;
    padding: 20px;
}

body.dark-mode .page-panel {
    background: #1a1a2e;
}

.hidden {
    display: none;
}

.back-to-home {
    background: #e2e8f0;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    margin-bottom: 20px;
    cursor: pointer;
    color: #334155;
    font-weight: 600;
    transition: all 0.2s;
}

body.dark-mode .back-to-home {
    background: #334155;
    color: #f1f5f9;
}

.back-to-home:hover {
    background: #3b82f6;
    color: white;
}

canvas {
    max-height: 300px;
    width: 100% !important;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

input, select, textarea, button {
    font-family: 'IRANSans', system-ui, -apple-system, Tahoma, sans-serif !important;
}