* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: #0a0a0a;
    color: #d4d4d4;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background-color: #111;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2a2a2a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.hamburger {
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    color: #aaa;
    padding: 6px 10px;
    border-radius: 8px;
}

.hamburger:hover { background: #1e1e1e; color: #fff; }

.app-title {
    font-size: 24px;
    font-weight: 700;
    color: #cfcfcf;
    flex: 1;
    text-align: center;
}

.top-bar-spacer { width: 40px; }

.sidebar-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    background: #151515;
    box-shadow: -5px 0 20px rgba(0,0,0,0.8);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding: 25px 15px;
    border-left: 1px solid #2c2c2c;
    overflow-y: auto;
}

.sidebar-overlay.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 12px;
}

.sidebar-title { font-size: 20px; font-weight: bold; color: #ddd; }

.sidebar-close { font-size: 28px; background: none; border: none; color: #aaa; cursor: pointer; }

.projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ddd;
}

.add-project-btn {
    background: #1f1f1f;
    border: 1px dashed #4a4a4a;
    color: #ccc;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.add-project-btn:hover { background: #2a2a2a; color: white; }

.project-list { list-style: none; margin-top: 10px; }

.project-item {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 5px;
}

.project-item:hover { background: #222; }

.project-name { font-weight: 600; flex: 1; }

.action-dots {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.action-dots:hover { background: #2a2a2a; color: white; }

.analysis-count {
    font-size: 11px;
    background: #222;
    padding: 2px 8px;
    border-radius: 20px;
    color: #aaa;
}

.analysis-section {
    padding: 25px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.current-project-title {
    font-size: 18px;
    background: #141414;
    padding: 10px 18px;
    border-radius: 40px;
    border: 1px solid #2c2c2c;
    margin-bottom: 15px;
}

/* فقط ارزش بازاری */
.market-value-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    background: #111;
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 12px 15px;
}

.market-label {
    font-size: 14px;
    color: #ccc;
    font-weight: bold;
    white-space: nowrap;
}

.market-value-input {
    flex: 1;
    min-width: 120px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    font-family: 'Courier New', monospace;
}

.market-value-input:focus { border-color: #5a5a5a; }

.financial-input {
    width: 100%;
    min-height: 250px;
    background: #101010;
    border: 1px solid #2e2e2e;
    border-radius: 18px;
    padding: 18px;
    color: #ececec;
    font-size: 13px;
    resize: vertical;
    outline: none;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.financial-input:focus { border-color: #5a5a5a; }

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.calculate-btn {
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    color: #eaeaea;
    padding: 14px 28px;
    border-radius: 40px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.calculate-btn:hover { background: #3a3a3a; }

.clear-btn {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    color: #aaa;
    padding: 14px 20px;
    border-radius: 40px;
    cursor: pointer;
}

.result-box {
    background: #111;
    border: 1px solid #2c2c2c;
    border-radius: 18px;
    padding: 25px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    color: #d0d0d0;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 2;
}

.result-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #555;
}

.download-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.download-btn {
    background: #1a3a1a;
    border: 1px solid #2a5a2a;
    color: #90ee90;
    padding: 12px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
}

.copy-btn {
    background: #1a1a3a;
    border: 1px solid #2a2a5a;
    color: #9090ee;
}

.analyses-history {
    margin-top: 25px;
    background: #111;
    border: 1px solid #2c2c2c;
    border-radius: 18px;
    padding: 20px;
}

.history-header {
    font-size: 16px;
    font-weight: bold;
    color: #ccc;
    margin-bottom: 15px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 10px;
}

.history-list { list-style: none; }

.history-item {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-symbol { font-weight: bold; color: #ddd; }
.history-date { font-size: 12px; color: #888; }

.history-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-card {
    background: #161616;
    border: 1px solid #333;
    border-radius: 24px;
    padding: 30px 25px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card h3 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 22px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 12px;
}

.field-label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 8px;
    font-weight: bold;
}

.input-field {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 14px 16px;
    color: #f0f0f0;
    margin-bottom: 20px;
    font-size: 15px;
    outline: none;
    resize: vertical;
}

.prompt-input {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    min-height: 150px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    background: #2a2a2a;
    border: 1px solid #3f3f3f;
    color: #ddd;
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary { background: #d4d4d4; color: #111; }

.context-menu {
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    padding: 8px;
    position: fixed;
    z-index: 3000;
    min-width: 200px;
}

.context-menu button {
    background: transparent;
    border: none;
    color: #ddd;
    padding: 10px 16px;
    width: 100%;
    text-align: right;
    cursor: pointer;
    font-size: 14px;
}

.context-menu button:hover { background: #2a2a2a; }

.hidden { display: none !important; }