/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --bg-highlight: #1e3a8a;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent-blue: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --profit-secured: #059669;
    --border-color: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* Navigation Menu */
.nav-menu {
    max-width: 1400px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    color: #f9fafb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-button:hover {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.nav-button.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    color: #f9fafb;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-button:hover {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
}

.dropdown.active .dropdown-content {
    display: block;
    animation: dropdownFade 0.3s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #f9fafb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid #374151;
}

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

.dropdown-item:hover {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    padding-left: 25px;
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3b82f6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Compact Header */
.header-compact {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: 12px;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2);
}

.header-compact h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #f9fafb;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.results-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Compact Cards */
.compact-card {
    padding: 15px;
}

.compact-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--accent-blue);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-blue);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.card h4 {
    color: var(--text-secondary);
    margin: 15px 0 10px 0;
    font-size: 0.95rem;
}

.highlight-card {
    background: linear-gradient(135deg, var(--bg-highlight) 0%, var(--bg-card) 100%);
    border-color: var(--accent-blue);
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group.compact {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input:hover,
.input-group select:hover {
    border-color: var(--accent-blue);
}

.input-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-group label:hover {
    background: var(--bg-highlight);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.status-banner.low {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.status-banner.moderate {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.status-banner.high {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.status-banner.profit {
    border-color: var(--profit-secured);
    background: rgba(5, 150, 105, 0.1);
}

.status-icon {
    font-size: 2rem;
    line-height: 1;
}

.status-text {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Collapsible Card */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header:hover {
    color: var(--accent-blue);
}

/* Result Placeholder */
.result-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Weight Inputs */
.weight-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Manual Fill Section */
.manual-fill-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Compact Footer */
.footer-compact {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.result-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-value.success {
    color: var(--success);
}

.result-value.warning {
    color: var(--warning);
}

.result-value.danger {
    color: var(--danger);
}

.result-value.profit-secured {
    color: var(--profit-secured);
}

.result-value.accent {
    color: var(--accent-blue);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 5px;
}

.status-badge.low {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.moderate {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.status-badge.high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-badge.profit {
    background: rgba(5, 150, 105, 0.2);
    color: var(--profit-secured);
    border: 1px solid var(--profit-secured);
}

/* Entry Levels */
.entry-level {
    padding: 15px;
    margin: 10px 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.entry-level.filled {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.entry-level.pending {
    border-left-color: var(--warning);
}

.entry-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-level-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.entry-level-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
}

.entry-detail {
    color: var(--text-secondary);
}

.entry-detail span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Portfolio Analysis */
.portfolio-metric {
    padding: 20px;
    margin: 15px 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.portfolio-metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.portfolio-metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-metric-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-fill.low {
    background: var(--success);
}

.progress-fill.moderate {
    background: var(--accent-blue);
}

.progress-fill.high {
    background: var(--danger);
}

/* Warning Box */
.warning-box {
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    border-radius: 8px;
    margin: 20px 0;
}

.warning-box h3 {
    color: var(--danger);
    margin-bottom: 10px;
}

.success-box {
    padding: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    border-radius: 8px;
    margin: 20px 0;
}

.success-box h3 {
    color: var(--success);
    margin-bottom: 10px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .input-column {
        order: 1;
    }
    
    .results-column {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header-compact h1 {
        font-size: 1.5rem;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .result-row {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .status-banner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s infinite;
}
