/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: 'BMitra';
    src: url('../font/BMitra.ttf') format('truetype'); /* For TTF format */
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: 'BYekan';
    src: url('../font/BYekan.ttf') format('truetype'); /* For TTF format */
    font-style: normal;
    font-weight: normal;
}

body {
    font-family: BYekan, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    padding: 20px;
    direction:rtl;
    max-width: 800px;
    margin-right:auto;
    margin-left:auto;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header styles */
header {
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.highlight {
    font-weight: bold;
    color: #4a90e2;
}

.btn {
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family:BYekan;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-align:center;
}

.btn-buy {
    background-color: #4caf50 !important;
}

.btn-sell {
    background-color: #f44336 !important;
}

.btn-back {
    background-color: #9e9e9e;
}

.btn-edit , .btn-delete {
    background-color: #2196f3;
    font-size: 12px;
    padding: 5px 10px !important;
}

.btn-delete {
    background-color: #f44336;
}

.btn-reload{
    background-color: #3877ff !important;
}

/* Transaction card styles */
.transactions {
    display: grid;
    gap: 20px;
}

.card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.card-buy {
    border-left: 5px solid #4caf50;
}

.card-sell {
    border-left: 5px solid #f44336;
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.transaction-type {
    font-weight: bold;
}

.transaction-date {
    font-size: 14px;
    color: #666;
}

.card-body p {
    margin-bottom: 5px;
}


.positive {
    color: #4caf50;
}

.negative {
    color: #f44336;
}

.note {
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin-top: 10px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Responsive design */
@media (min-width: 768px) {
    .container {
        max-width: 750px;
    }

    .asset-info {
        flex-direction: row;
        justify-content: space-between;
    }

    .transactions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
    }

    .transactions {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* Dashboard styles */
/* General styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
    padding-top: 0;
}

.dashboard-container header{
    margin:0;    
}

/* Header styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #b0a8a8;
    padding-bottom: 15px;
}

.dashboard-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

#chartContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 35vh;
    padding-top:10px;
}

canvas{
   max-height: 100%;
   max-width: 100%; 
   width:auto !important;
   height:auto !important;
}

.price-list-btn{
    width:100%;    
}

/* Navigation styles */
.top-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}

.top-nav a{
    font-size:12px;    
}

/* Button styles */
.btn {
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-secondary {
    background-color: #9e9e9e !important;
}

.btn-secondary:hover {
    background-color: #7f8c8d  !important;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
}

.btn-add {
    background-color: #2ecc71;
    color: white;
    border-radius: 7px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:hover {
    opacity: 0.9;
}

/* Portfolio summary styles */
.portfolio , .asset-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    margin-top: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.portfolio{
    flex-direction:column;    
}

/* For tablets and larger screens */
@media (min-width: 768px) { 
    .portfolio {
        flex-direction: row; 
        justify-content:space-between;
    }
    
    #chartContainer{
        justify-content: flex-end;
    }
}


.portfolio-summary{
    display:flex;
    width:100%;
    justify-content:space-between;
    border-bottom: 1px solid #e9ecef;
    padding-bottom:20px;
}

.portfolio-title {
    color: #7f8c8d;
    margin-bottom: 5px;
}

.portfolio-value , .prtfolio-buttons {
    display:flex;
    flex-direction:column;
    align-items: center;
}
 
.portfolio-value{
    align-items: flex-start;
    justify-content: center;
}

.portfolio-value .value {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    padding-right: 10px;
}

.prtfolio-buttons {
    gap:10px;   
    align-items: flex-end;
}
/* Asset grid styles */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.asset-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.asset-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 16px;
}

.row{
    display: flex;
    justify-content: space-between;
}

.asset-title-icon{
    display: flex; 
    gap: 10px;
}

.asset-icon {
    width:32px;
    height:32px;
}

.asset-title{
    color:#868686;
    font-weight:bold;    
}

.asset-quantity {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.label-wrapper{
    display:flex;
    align-items:center;
}

.asset-value {
    font-size: 20px;
    font-weight: bold;
}

.numeric{
    font-family:BMitra;
}

.profit, .loss{
    direction: ltr;
}

.profit{
    color:green;
}

.loss{
    color:red;
}

/* Edit form styles */

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
    margin: 0 5px;
}

/* Responsive design for form actions */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        margin: 5px 0;
    }
}

/* Transaction form styles */
.transaction-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.transaction-header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.form-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: normal;    color: #34495e;
    gap: 10px;
}

.form-group label i {
    margin-right: 10px;
    color: #3498db;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'BYEKAN';
    font-size: 16px;
    transition: border-color 0.3s ease;
    flex:1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary {
    background-color: #2ecc71;
}

.btn-primary:hover {
    background-color: #27ae60;
}

/* Responsive design */
@media (max-width: 768px) {
    .transaction-container {
        padding: 10px;
    }

    .transaction-header .btn-back {
        margin-top: 10px;
    }
}


/* Responsive design for transaction form */
@media (min-width: 768px) {
    .transaction-form {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 95vh;
    background-color: #f4f4f4;
}

.login-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: bold;
}

.error-message {
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form .form-actions {
    margin-top: 1.5rem;
}

.login-form .btn-primary {
    width: 100%;
}

/* Responsive design for login form */
@media (min-width: 768px) {
    .login-form {
        padding: 2.5rem;
    }
}

/* Change Password form styles */
.change-password-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-header{
    display:flex;
    justify-content:space-between;
}

.success-message {
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Responsive design for change password form */
@media (min-width: 768px) {
    .change-password-form {
        max-width: 500px;
        margin: 0 auto;
    }
}


/* Detail page styles */
.detail-container {
    margin: 0 auto;
    padding: 20px;
}

.detail-header , .price-list-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.detail-header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.asset-summary{
    flex-direction:row;    
    margin-bottom:20px;
}

.column{
    display:flex;
    flex-direction:column;
    justify-content: space-between;
    align-items: center;
}

.asset-icon-large{
    width:64px;
    height:64px;
}

.quantity{
    font-size: 12px;
    font-weight: bold;
}

.average-label , .current-label , .unit-label {
    font-size: 12px;
}

.unit-price{
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}

.unit-label{
    font-weight:bold;    
}

.average-value{
    padding-top: 5px;
}

.current-average-value{
    font-size: 13px;
}

.total-value{
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;    
}

.current-total-value{
    font-size:13px;
}

.current-value , .loss-profit {
    font-size:14px; 
    font-weight: bold;
    direction:rtl !important;
}

.loss-profit{
    padding-top:5px;
}

.action-buttons {
    display: flex;
    justify-content: space-around;
    gap: 25px;
    margin-bottom: 20px;
}

.btn-buy, .btn-sell {
    margin:5px;
    flex:1;
    text-align: center;
}

.transactions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.transaction-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.transaction-date {
    font-size: 14px;
    color: #7f8c8d;
    font-family:BMitra;
}

.buy-sell{
    font-weight:bold;    
    padding-top:5px;
}

.each-unit-price{
    font-family:BMitra;
    color: #7f8c8d;
}

.transaction-card .card-body {
    padding: 5px;
    padding-left: 10px;
    padding-right: 10px;
}

.transaction-card .card-body p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.transaction-card .card-body i {
    margin-right: 10px;
    width: 20px;
    color: #3498db;
}

.transactions-label{
    padding-bottom:5px;  
    padding-top:5px;
}

.transactions-description{
    font-size: 13px;
    padding-bottom: 20px;
    padding-right:10px;
    color: #7f8c8d;
}

.total-buy-price , .total-profit-loss{
    font-family:BMitra;  
    font-size:18px;
    direction:rtl !important;
}

.value {
    font-weight: bold;
    margin-left: auto;
}

.note {
    font-style: italic;
    color: #7f8c8d;
}

.transactions-container{
    display:none;
}

.transactions-container.active{
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    padding-top: 15px;
    justify-content: center;
    align-items: center;
}

.transactions-container .transaction-card{
    width: 95%;
}

.transaction-card .card-footer { 
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top:0;
}


.symbol-group {
    cursor: pointer;
}

.symbols-summary{
    display: flex;
    width: 100%;
    justify-content: space-around;
    border-bottom: 1px solid #e9ecef;
    padding-bottom:20px;
}

.symbol-name{
    font-weight:bold;
}

.transaction-card .row{
    padding-bottom:5px;
}

.transaction-card .row2 , .transaction-card .row3 , .transaction-card .row4 {
    font-family:BMitra;
}

.symbol-group .total-quantity , .symbol-group .symbol-total-current {
    font-family:BMitra;
    font-weight:bold;
    color:black;
}

.group-average-price  , .group-current-price{
    color:#7f8c8d;
    font-family:BMitra;
}

.group-price{
    display:flex;
    justify-content:space-between;
    width:100%;
}

/* Responsive design */
@media (min-width: 768px) {
    .asset-summary {
        flex-direction: row;
        justify-content: space-around;
    }

    .summary-item {
        flex-direction: column;
        align-items: center;
    }

    .summary-label {
        margin-bottom: 5px;
    }
}

/* Date Picker */
.form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: pointer;
}

.pwt-datepicker {
    font-family: 'Vazir', sans-serif;
}

.pwt-datepicker-plot-area {
    font-size: 14px;
}
