/* ============================================
   PORTFOLIO (portfolio.css)
   ============================================ */

/* --- PORTFÖY KART & FORM TASARIMLARI --- */
.app-portfolio-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.app-portfolio-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.app-portfolio-title {
    margin: 0;
    color: #1a1a1a;
    font-weight: bold;
}

.app-portfolio-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.app-btn-primary {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.app-btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.app-btn-back {
    background: none;
    border: none;
    color: #0056b3;
    cursor: pointer;
    margin-right: 5px;
    font-size: 16px;
}

/* --- ÖZET KUTULARI (DASHBOARD) --- */
.app-summary-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.app-summary-box {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.app-summary-box.blue-border {
    border-left: 4px solid #0056b3;
}

.app-summary-box.green-border {
    border-left: 4px solid #28a745;
}

.app-summary-title {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.app-summary-val {
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
    margin-top: 5px;
}

/* --- LİSTE VE KART TASARIMI --- */
.app-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.app-empty-state {
    padding: 20px;
    text-align: center;
    color: #868e96;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.app-portfolio-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s;
}

.app-portfolio-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.app-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px;
}

.app-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.app-card-ticker {
    font-weight: 800;
    font-size: 16px;
    color: #1a202c;
    letter-spacing: 0.5px;
}

.app-card-subtitle,
.app-card-value-title,
.app-card-detail-label {
    font-size: 11px;
    color: #718096;
}

.app-card-value-box {
    text-align: right;
}

.app-card-value-title {
    margin-bottom: 2px;
}

.app-card-value {
    font-weight: bold;
    font-size: 16px;
    color: #1a202c;
}

.app-card-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 15px;
}

.app-card-details-group {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.app-card-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-card-detail-val {
    font-weight: 600;
    color: #2d3748;
}

.app-card-pnl-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-card-pnl-label {
    color: #1a202c;
    font-weight: 500;
    font-size: 12px;
}

.app-card-pnl-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}

/* --- FORM TASARIMI --- */
.app-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.app-form-group {
    flex: 1;
    margin-bottom: 15px;
}

.app-form-group.no-margin {
    margin-bottom: 0;
}

.app-form-group.mb-20 {
    margin-bottom: 20px;
}

.app-form-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.app-form-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.app-form-input.uppercase {
    text-transform: uppercase;
}

.app-btn-toggle {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.app-btn-save {
    width: 100%;
    padding: 12px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Portföy butonuna basılma hissi (Click Feedback) */
#btnOpenPortfolio {
    transition: transform 0.1s ease, opacity 0.1s ease !important;
}

#btnOpenPortfolio:active {
    transform: scale(0.92) !important;
    opacity: 0.8 !important;
}

/* --- DÜZENLE (KALEM) BUTONU EFEKTLERİ --- */
.app-btn-edit-card {
    opacity: 0;
    /* Başlangıçta tamamen görünmez */
    transform: scale(0.9);
    /* Animasyon için hafif küçük başlar */
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s !important;
    font-size: 13px !important;
    color: #a0aec0 !important;
}

/* 1. Kartın üzerine (herhangi bir yerine) gelince kalemi göster */
.app-portfolio-card:hover .app-btn-edit-card {
    opacity: 1;
    transform: scale(1);
}

/* 2. Kalemin tam üzerine gelince tıklama hissi için rengini koyulaştır */
.app-btn-edit-card:hover {
    color: #4a5568 !important;
}

/* --- PORTFOLIO MOBILE HİZALAMALARI --- */
@media (max-width: 820px) {
    #portfolio-form-container {
        padding: 0 !important;
    }

    #portfolioModal {
        position: fixed !important;
        top: 60px !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100% - 60px) !important;
        z-index: 99999 !important;
        background-color: #f1f3f5 !important;
        overflow-y: auto !important;
    }

    .app-portfolio-dashboard-wrapper,
    .app-portfolio-form-wrapper {
        min-height: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding-top: 28px !important;
        padding-bottom: 40px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .app-portfolio-dashboard-wrapper h3 {
        font-size: 17px !important;
    }

    #btn-go-to-form {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* 🚀 MOBİL: Kalem başlangıçta tamamen gizli ve tıklanamaz */
    .app-btn-edit-card {
        opacity: 0 !important;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    
    /* 🚀 MOBİL: Karta tıklandığında (active-mobile-edit sınıfı alınca) kalemi göster */
    .app-portfolio-card.active-mobile-edit .app-btn-edit-card {
        opacity: 1 !important;
        pointer-events: auto;
    }
}

/* --- İŞLEM GEÇMİŞİ LİSTESİ (TRANSACTION HISTORY) --- */
.app-transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 12px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-transaction-item:hover {
    background: #fff;
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.app-tx-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-tx-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-tx-type {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.app-tx-type.buy { background: #d1fae5; color: #065f46; }
.app-tx-type.sell { background: #fee2e2; color: #991b1b; }

.app-tx-date { font-size: 11px; color: #718096; font-weight: 500; }
.app-tx-price { font-weight: bold; font-size: 14px; color: #1a202c; }
.app-tx-qty { font-size: 12px; color: #4a5568; }