/* Avanza-inspired GAV Calculator Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f6f8fa;
    color: #1a1a1a;
    line-height: 1.5;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e1e5e9;
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
}

.header-content {
    text-align: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #00c896;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0 1.5rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

/* Portfolio Overview */
.overview-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.overview-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

.stat-value.highlight {
    color: #00c896;
    font-size: 1.75rem;
}

/* Form Card */
.form-card, .holdings-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.form-card h3, .holdings-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

/* Form Styles */
.stock-form {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #00c896;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    display: block;
}

/* Buttons */
.btn-primary {
    background: #00c896;
    color: #ffffff;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    justify-self: start;
}

.btn-primary:hover {
    background: #00b085;
}

.btn-secondary {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e1e5e9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f6f8fa;
    border-color: #d1d5db;
}

.btn-remove {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-remove:hover {
    background: #dc2626;
}

/* Holdings List */
.holdings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.holding-item {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f9fafb;
}

.holding-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.stock-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.holding-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.holding-stat {
    display: flex;
    flex-direction: column;
}

.holding-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.holding-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.holding-stat-value.positive {
    color: #00c896;
}

.holding-stat-value.negative {
    color: #ef4444;
}

/* Purchases List */
.purchases-list {
    margin-top: 1rem;
    border-top: 1px solid #e1e5e9;
    padding-top: 1rem;
}

.purchase-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.purchase-item:last-child {
    border-bottom: none;
}

.purchase-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.purchase-details {
    font-size: 0.875rem;
    color: #374151;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-subtitle {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #6b7280;
}

.close:hover {
    color: #1a1a1a;
}

.modal-content h3 {
    color: #00c896;
    margin-bottom: 1rem;
}

.modal-content h4 {
    color: #1a1a1a;
    margin: 1rem 0 0.5rem;
}

.modal-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.modal-content li {
    margin-bottom: 0.25rem;
}

/* Footer */
.footer {
    background: #ffffff;
    border-top: 1px solid #e1e5e9;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: #6b7280;
    font-size: 0.875rem;
}

.info-btn {
    background: transparent;
    color: #00c896;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

.info-btn:hover {
    color: #00b085;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 0;
    }
    
    .header {
        padding: 1.5rem 1rem 1rem;
        margin-bottom: 1rem;
    }
    
    .main-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .form-card, .holdings-card, .overview-card {
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .overview-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .holding-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .purchase-item {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }
    
    .purchase-details {
        font-size: 0.75rem;
    }
    
    .footer {
        flex-direction: column;
        gap: 1rem;
    }
}