/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

/* Typography Utilities */
.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--accent-success);
}

.text-danger {
    color: var(--accent-danger);
}

/* Navbar Styles */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-8);
    background: rgba(20, 20, 22, 0.8);
    /* Semi-transparent */
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Gold Shine Animation Removed */

.logo-icon {
    color: #1F51FF;
    /* Neon Blue - Strong & Bright */
    font-size: 1.25rem;
    text-shadow: 0 0 10px #E3D9C6, 0 0 20px #FFD700;
    /* Static Gold Glow */
}

.nav-links {
    display: flex;
    gap: var(--space-6);
    background: var(--bg-card);
    padding: 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Active link state handled via JS classes usually, but simple hover for now */
.nav-link.active {
    background: var(--bg-panel);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: white;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Page Headers */
h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
}

/* Top Level Component Styling */

/* Cards */
.stock-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: relative;
    overflow: hidden;
}

.stock-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ticker {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.company-name {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.price-block {
    text-align: right;
}

.price {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.change {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Badges */
.badge-row {
    display: flex;
    gap: var(--space-2);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-outline {
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.bg-success,
.badge-success {
    background: rgba(0, 232, 128, 0.15);
    color: var(--accent-success);
}

.bg-danger,
.badge-danger {
    background: rgba(255, 69, 58, 0.15);
    color: var(--accent-danger);
}

.bg-warning,
.badge-warning {
    background: rgba(255, 179, 64, 0.15);
    color: var(--accent-warning);
}

/* Rationale */
.rationale {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    margin-top: var(--space-2);
}

.rationale-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.rationale-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #2563EB;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    width: 100%;
}

.btn-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Home Layout Specifics */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-8);
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.date-display {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    padding-bottom: 6px;
}

.interest-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.section-label {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.tags-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tag {
    font-size: var(--font-size-sm);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.tag.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    /* Slightly wider for better layout */
    padding: var(--space-6);
    /* Reduced padding */
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    /* Prevent off-screen overflow */
    overflow-y: auto;
    /* Scrollable content */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.close-modal {
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.close-modal:hover {
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
}

.form-actions {
    margin-top: var(--space-4);
    display: flex;
    justify-content: flex-end;
}

/* Holdings Grid */
.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

.holding-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.holding-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-4);
}

.holding-ticker {
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
}

.detail-row .label {
    color: var(--text-muted);
}

.status-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.status-intact {
    background: rgba(0, 232, 128, 0.1);
    color: var(--accent-success);
}

.status-weakening {
    background: rgba(255, 179, 64, 0.1);
    color: var(--accent-warning);
}

.status-broken {
    background: rgba(255, 69, 58, 0.1);
    color: var(--accent-danger);
}

.holding-actions {
    margin-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-4);
    text-align: center;
}

.btn-text {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

/* Tooltips */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--bg-panel);
    color: var(--text-primary);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    /* Position above */
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    pointer-events: none;
    /* Let clicks pass through */
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--bg-panel) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}