/* Common styles for all BallisticsToolkit pages */

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   LOGO & BRANDING
   ========================================================================== */
.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 1.2em;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.nav-logo-text {
    white-space: nowrap;
}

.nav-logo:hover {
    color: #3498db;
    text-decoration: none;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.main-logo {
    height: 80px;
    width: auto;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.nav-header {
    background: #2c3e50;
    color: white;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-logo:hover {
    color: #3498db;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    background-color: #3498db;
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.form-section h3 {
    margin-top: 0;
    color: #555;
}


.params-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 12px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.param-item {
    min-width: 120px;
}

.param-item label {
    display: block;
    font-size: 11px;
    color: #555;
    margin-bottom: 3px;
}

/* Input styling - consistent across both apps */
input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* App-specific container styles */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.app-container h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}


/* ==========================================================================
   DATA DISPLAY
   ========================================================================== */
.results {
    margin-top: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
    color: #333;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    color: red;
    background-color: #ffe6e6;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status indicators */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-wip {
    background: #fbbf24;
    color: white;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        padding: 10px;
    }
}


/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.help-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced modal positioning for apps with WebGL/Canvas contexts */
/* WebGL creates its own stacking context, so we need a very high z-index */
.help-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    background-color: rgba(0,0,0,0.5) !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Only show flex when modal is visible (not hidden) */
.help-modal:not([style*="display: none"]) {
    display: flex !important;
}

.help-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-modal-header {
    background: #007bff;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-modal-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.help-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.help-close:hover {
    opacity: 0.7;
}

.help-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.help-section h3 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1.1em;
}

.help-section p {
    margin: 5px 0;
    line-height: 1.4;
}

.param-help {
    font-size: 0.9em;
    line-height: 1.5;
}

.help-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-section li {
    margin: 5px 0;
}

/* ==========================================================================
   CONTENT PATTERNS
   ========================================================================== */
.content-section {
    margin-bottom: 30px;
}

/* Feature grid pattern (for about page and future use) */
.feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.feature-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid #007bff;
    flex: 1 1 300px;
    min-width: 250px;
}

.feature-box h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.feature-box p {
    margin: 0;
    font-size: 1em;
    color: #555;
}

/* Tech list pattern (for about page) */
.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    list-style: none;
    padding: 0;
}

.tech-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid #28a745;
    flex: 1 1 300px;
    min-width: 250px;
}

.tech-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

/* Highlight box pattern */
.highlight-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin-bottom: 25px;
}

/* Mobile responsive for help modal */
@media (max-width: 768px) {
    .help-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .help-modal-body {
        padding: 15px;
    }
}
