/* Portfolio Specific Styles */

/* Inherit variables from main style.css where possible */
:root {
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    /* Keep blue for specific portfolio actions if needed, or switch to white/grey */
}

/* Remove Body/Root overrides as they are handled by main style.css */

/* Layout overrides */
.container {
    padding: 20px;
}

/* Glass Panel -> Card Style */
.glass-panel {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

/* Portfolio Summary */
.portfolio-summary {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-item .label {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-item .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.summary-item .percentage {
    font-size: 1rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Form Styles */
.add-transaction {
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#transaction-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #a0a0a0;
}

.form-group input,
.form-group select {
    background: #2a2a2a;
    /* Slightly lighter than bg-secondary */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn-add {
    grid-column: span 2;
    background: var(--accent-color);
    color: var(--bg-color);
    /* Dark text on white button */
    border: none;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-top: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Assets Grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.asset-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
}

.asset-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.asset-name {
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: capitalize;
    color: var(--accent-color);
}

.asset-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-label {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Utilities */
.text-green {
    color: var(--accent-green) !important;
}

.text-red {
    color: var(--accent-red) !important;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .glass-panel {
        padding: 1.25rem;
    }

    #transaction-form {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .btn-add {
        grid-column: span 1;
    }

    .portfolio-summary {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .type-selector {
        flex-direction: row;
        /* Ensure they stay side-by-side */
    }
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #a0a0a0;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Type Selector */
.type-selector {
    display: flex;
    background: #2a2a2a;
    border-radius: 5px;
    padding: 4px;
    gap: 4px;
}

.type-selector input[type="radio"] {
    display: none;
}

.type-selector label {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #a0a0a0;
    margin-bottom: 0;
}

.type-selector label:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

#type-buy:checked+label[for="type-buy"] {
    background: var(--accent-green);
    color: white;
}

#type-sell:checked+label[for="type-sell"] {
    background: var(--accent-red);
    color: white;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Login Screen - Centered Card Style */
#login-screen {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

#login-screen h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

#login-screen p {
    color: #a0a0a0;
    margin-bottom: 2rem;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#login-form .btn-add {
    margin-top: 0;
}

/* Table Styles for History and Admin */
.history-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.history-table th,
.admin-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0a0 !important;
    font-weight: 600;
    background: transparent !important;
    /* Ensure no weird background */
}

.history-table td,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.history-table tr:hover,
.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}