/* =====================================================
   TOOL COMMON STYLES
   Shared styling for all Matrix Portal tools
   ===================================================== */

/* Tool Container */
.tool-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 20px;
    position: relative;
    z-index: 5;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    position: relative;
}

.tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.tool-title {
    color: #00ff41;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.tool-subtitle {
    color: #00aaff;
    font-size: 1.2rem;
    margin: 0;
}

/* Tool Sections */
.tool-section {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.section-title {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.section-description {
    color: #888;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    gap: 2rem;
}

.calc-input-group {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.calc-input-group label {
    color: #00ffaa;
    font-weight: bold;
    white-space: nowrap;
}

/* Tool Inputs */
.tool-input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.tool-input:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

.sequence-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

.sequence-textarea:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

/* Tool Buttons */
.tool-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.tool-btn.primary {
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
}

.tool-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4);
}

.tool-btn.secondary {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
}

.tool-btn.secondary:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Result Display */
.result-display {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-label {
    color: #00aaff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.result-value {
    color: #00ff41;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.result-value.prime {
    color: #00ffaa;
}

.result-value.not-prime {
    color: #ff6600;
}

.result-factors {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.result-status {
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: bold;
}

.result-status.prime {
    color: #00ffaa;
}

.result-status.not-prime {
    color: #ff6600;
}

/* Sequence Display */
.sequence-display {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
}

.seq-item {
    display: inline-block;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem 1rem;
    margin: 0.3rem;
    border-radius: 5px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.seq-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* Mersenne Display */
.mersenne-result {
    text-align: center;
    padding: 2rem;
}

.result-formula {
    color: #00aaff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.mersenne-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.mersenne-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    border-radius: 5px;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.m-label {
    color: #00aaff;
    font-weight: bold;
}

.m-value {
    color: #00ff41;
    font-weight: bold;
    text-align: center;
}

.m-formula {
    color: #888;
    font-size: 0.9rem;
}

/* Prime List */
.prime-list {
    margin-top: 1rem;
}

.prime-count {
    color: #00ffaa;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.prime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}

.prime-number {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
}

/* Ratio Grid */
.ratio-grid {
    font-family: 'Courier New', monospace;
}

.ratio-header {
    background: rgba(0, 255, 65, 0.1);
    color: #00ffaa;
    padding: 0.5rem;
    font-weight: bold;
    border-bottom: 2px solid #00ff41;
    font-size: 0.9rem;
}

.ratio-row {
    display: grid;
    grid-template-columns: 50px 100px 100px 150px 150px;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    font-size: 0.9rem;
}

.ratio-row.converged {
    background: rgba(0, 255, 170, 0.1);
}

.ratio-row span {
    padding: 0.3rem;
}

.ratio-footer {
    background: rgba(0, 255, 65, 0.1);
    color: #00aaff;
    padding: 1rem;
    margin-top: 0.5rem;
    text-align: center;
    font-weight: bold;
    border-radius: 5px;
}

/* Analysis Results */
.result-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.result-title {
    color: #00ffaa;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: rgba(0, 255, 65, 0.05);
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.info-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.3rem;
}

.info-value {
    color: #00ff41;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Pattern Display */
.pattern-display {
    padding: 1rem;
}

.pattern-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.type-label {
    color: #00aaff;
    font-weight: bold;
}

.type-value {
    color: #00ff41;
    font-size: 1.5rem;
    font-weight: bold;
}

.pattern-confidence {
    margin: 1rem 0;
}

.confidence-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.confidence-bar {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    border-radius: 5px;
    height: 30px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.confidence-fill.high {
    background: linear-gradient(90deg, #00ff41, #00ffaa);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #ffaa00, #ff8800);
}

.confidence-fill.low {
    background: linear-gradient(90deg, #ff6600, #ff3300);
}

.confidence-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.pattern-desc,
.pattern-formula {
    color: #888;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 5px;
}

.pattern-formula {
    font-family: 'Courier New', monospace;
    color: #00aaff;
}

/* Analysis Rows */
.analysis-row {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 5px;
}

.analysis-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.number-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.num-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 0.8rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.num-item.error {
    border-color: #ff6600;
    color: #ff6600;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.badge.success {
    background: rgba(0, 255, 170, 0.2);
    border: 1px solid #00ffaa;
    color: #00ffaa;
}

.badge.info {
    background: rgba(0, 170, 255, 0.2);
    border: 1px solid #00aaff;
    color: #00aaff;
}

/* Reference Grid */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ref-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.ref-card:hover {
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    transform: translateY(-5px);
}

.ref-card h4 {
    color: #00ffaa;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ref-example {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 3px;
}

.ref-desc {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.ref-formula {
    color: #00aaff;
    font-family: 'Courier New', monospace;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 3px;
}

/* Information Panel */
.info-panel {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid rgba(0, 255, 65, 0.5);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-panel h3 {
    color: #00ff41;
    font-size: 1.3rem;
    margin: 1.5rem 0 0.5rem 0;
}

.info-panel h3:first-child {
    margin-top: 0;
}

.info-panel p {
    color: #ccc;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.formula {
    color: #00aaff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 5px;
}

.info-list {
    color: #ccc;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.info-list li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.info-list strong {
    color: #00ffaa;
}

/* Tool Navigation */
.tool-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 3rem 0 2rem 0;
}

.tool-nav-btn {
    padding: 1rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
}

.tool-nav-btn:not(.secondary) {
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
}

.tool-nav-btn:not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4);
}

.tool-nav-btn.secondary {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
}

.tool-nav-btn.secondary:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Tool Footer */
.tool-footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    margin-top: 3rem;
}

/* Animations */
@keyframes result-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .calc-input-group {
        grid-template-columns: 1fr;
    }
    
    .ratio-row {
        grid-template-columns: 1fr;
        font-size: 0.8rem;
    }
    
    .tool-navigation {
        flex-direction: column;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .mersenne-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .prime-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
}

/* =====================================================
   CRITICAL FIX: Ensure tool content is always visible
   Override any parent CSS that might hide content
   ===================================================== */

.tool-section,
.tool-header,
.calculator-grid,
.result-display,
.reference-grid,
.info-panel {
    opacity: 1 !important;
}

/* =====================================================
   INFO SECTION - Educational Content
   ===================================================== */

.info-section {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-section h2 {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.info-section h3 {
    color: #00ffaa;
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-section h4 {
    color: #00aaff;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
}

.info-section p {
    color: #888;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.info-section ul,
.info-section ol {
    color: #888;
    line-height: 1.8;
    margin: 1rem 0;
    padding-left: 2rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section strong {
    color: #00ffaa;
}

.info-section code {
    background: rgba(0, 0, 0, 0.5);
    color: #00ff41;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Sequence Type Cards in Info Section */
.sequence-type-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.sequence-type-card h4 {
    color: #00ff41;
    margin-top: 0;
}

.sequence-type-card p {
    margin-bottom: 0.5rem;
}

/* Related Tools Section */
.related-tools {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.related-tools h2 {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tool-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tool-link-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tool-link-card:hover {
    border-color: #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    transform: translateY(-3px);
}

.tool-link-card h3 {
    color: #00ff41;
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
}

.tool-link-card p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* Tool Footer */
.tool-footer {
    text-align: center;
    margin: 3rem 0 2rem 0;
    padding: 2rem 0;
}

.back-link {
    display: inline-block;
    color: #00ff41;
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid #00ff41;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.back-link:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Breadcrumb Navigation */
.breadcrumb {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.breadcrumb a {
    color: #00ffaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #00ff41;
    text-decoration: underline;
}

.breadcrumb span {
    color: #00ff41;
}/* =====================================================
   TOOL COMMON STYLES
   Shared styling for all Matrix Portal tools
   ===================================================== */

/* Tool Container */
.tool-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 20px;
    position: relative;
    z-index: 5;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    position: relative;
}

.tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.tool-title {
    color: #00ff41;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.tool-subtitle {
    color: #00aaff;
    font-size: 1.2rem;
    margin: 0;
}

/* Tool Sections */
.tool-section {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.section-title {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.section-description {
    color: #888;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    gap: 2rem;
}

.calc-input-group {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.calc-input-group label {
    color: #00ffaa;
    font-weight: bold;
    white-space: nowrap;
}

/* Tool Inputs */
.tool-input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.tool-input:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

.sequence-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

.sequence-textarea:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

/* Tool Buttons */
.tool-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.tool-btn.primary {
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
}

.tool-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4);
}

.tool-btn.secondary {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
}

.tool-btn.secondary:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Result Display */
.result-display {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-label {
    color: #00aaff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.result-value {
    color: #00ff41;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.result-value.prime {
    color: #00ffaa;
}

.result-value.not-prime {
    color: #ff6600;
}

.result-factors {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.result-status {
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: bold;
}

.result-status.prime {
    color: #00ffaa;
}

.result-status.not-prime {
    color: #ff6600;
}

/* Sequence Display */
.sequence-display {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
}

.seq-item {
    display: inline-block;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem 1rem;
    margin: 0.3rem;
    border-radius: 5px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.seq-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* Mersenne Display */
.mersenne-result {
    text-align: center;
    padding: 2rem;
}

.result-formula {
    color: #00aaff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.mersenne-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.mersenne-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    border-radius: 5px;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.m-label {
    color: #00aaff;
    font-weight: bold;
}

.m-value {
    color: #00ff41;
    font-weight: bold;
    text-align: center;
}

.m-formula {
    color: #888;
    font-size: 0.9rem;
}

/* Prime List */
.prime-list {
    margin-top: 1rem;
}

.prime-count {
    color: #00ffaa;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.prime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}

.prime-number {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
}

/* Ratio Grid */
.ratio-grid {
    font-family: 'Courier New', monospace;
}

.ratio-header {
    background: rgba(0, 255, 65, 0.1);
    color: #00ffaa;
    padding: 0.5rem;
    font-weight: bold;
    border-bottom: 2px solid #00ff41;
    font-size: 0.9rem;
}

.ratio-row {
    display: grid;
    grid-template-columns: 50px 100px 100px 150px 150px;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    font-size: 0.9rem;
}

.ratio-row.converged {
    background: rgba(0, 255, 170, 0.1);
}

.ratio-row span {
    padding: 0.3rem;
}

.ratio-footer {
    background: rgba(0, 255, 65, 0.1);
    color: #00aaff;
    padding: 1rem;
    margin-top: 0.5rem;
    text-align: center;
    font-weight: bold;
    border-radius: 5px;
}

/* Analysis Results */
.result-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.result-title {
    color: #00ffaa;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: rgba(0, 255, 65, 0.05);
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.info-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.3rem;
}

.info-value {
    color: #00ff41;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Pattern Display */
.pattern-display {
    padding: 1rem;
}

.pattern-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.type-label {
    color: #00aaff;
    font-weight: bold;
}

.type-value {
    color: #00ff41;
    font-size: 1.5rem;
    font-weight: bold;
}

.pattern-confidence {
    margin: 1rem 0;
}

.confidence-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.confidence-bar {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    border-radius: 5px;
    height: 30px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.confidence-fill.high {
    background: linear-gradient(90deg, #00ff41, #00ffaa);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #ffaa00, #ff8800);
}

.confidence-fill.low {
    background: linear-gradient(90deg, #ff6600, #ff3300);
}

.confidence-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.pattern-desc,
.pattern-formula {
    color: #888;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 5px;
}

.pattern-formula {
    font-family: 'Courier New', monospace;
    color: #00aaff;
}

/* Analysis Rows */
.analysis-row {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 5px;
}

.analysis-label {
    color: #00aaff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.number-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.num-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 0.8rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.num-item.error {
    border-color: #ff6600;
    color: #ff6600;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.badge.success {
    background: rgba(0, 255, 170, 0.2);
    border: 1px solid #00ffaa;
    color: #00ffaa;
}

.badge.info {
    background: rgba(0, 170, 255, 0.2);
    border: 1px solid #00aaff;
    color: #00aaff;
}

/* Reference Grid */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ref-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.ref-card:hover {
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    transform: translateY(-5px);
}

.ref-card h4 {
    color: #00ffaa;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ref-example {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 3px;
}

.ref-desc {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.ref-formula {
    color: #00aaff;
    font-family: 'Courier New', monospace;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 3px;
}

/* Information Panel */
.info-panel {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid rgba(0, 255, 65, 0.5);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-panel h3 {
    color: #00ff41;
    font-size: 1.3rem;
    margin: 1.5rem 0 0.5rem 0;
}

.info-panel h3:first-child {
    margin-top: 0;
}

.info-panel p {
    color: #ccc;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.formula {
    color: #00aaff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 5px;
}

.info-list {
    color: #ccc;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.info-list li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.info-list strong {
    color: #00ffaa;
}

/* Tool Navigation */
.tool-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 3rem 0 2rem 0;
}

.tool-nav-btn {
    padding: 1rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
}

.tool-nav-btn:not(.secondary) {
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
}

.tool-nav-btn:not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4);
}

.tool-nav-btn.secondary {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
}

.tool-nav-btn.secondary:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Tool Footer */
.tool-footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    margin-top: 3rem;
}

/* Animations */
@keyframes result-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .calc-input-group {
        grid-template-columns: 1fr;
    }
    
    .ratio-row {
        grid-template-columns: 1fr;
        font-size: 0.8rem;
    }
    
    .tool-navigation {
        flex-direction: column;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .mersenne-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .prime-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
}

/* =====================================================
   CRITICAL FIX: Ensure tool content is always visible
   Override any parent CSS that might hide content
   ===================================================== */

.tool-section,
.tool-header,
.calculator-grid,
.result-display,
.reference-grid,
.info-panel {
    opacity: 1 !important;
}

/* =====================================================
   INFO SECTION - Educational Content
   ===================================================== */

.info-section {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-section h2 {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.info-section h3 {
    color: #00ffaa;
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-section h4 {
    color: #00aaff;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
}

.info-section p {
    color: #888;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.info-section ul,
.info-section ol {
    color: #888;
    line-height: 1.8;
    margin: 1rem 0;
    padding-left: 2rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section strong {
    color: #00ffaa;
}

.info-section code {
    background: rgba(0, 0, 0, 0.5);
    color: #00ff41;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Sequence Type Cards in Info Section */
.sequence-type-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.sequence-type-card h4 {
    color: #00ff41;
    margin-top: 0;
}

.sequence-type-card p {
    margin-bottom: 0.5rem;
}

/* Related Tools Section */
.related-tools {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.related-tools h2 {
    color: #00ff41;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tool-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tool-link-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tool-link-card:hover {
    border-color: #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    transform: translateY(-3px);
}

.tool-link-card h3 {
    color: #00ff41;
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
}

.tool-link-card p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* Tool Footer */
.tool-footer {
    text-align: center;
    margin: 3rem 0 2rem 0;
    padding: 2rem 0;
}

.back-link {
    display: inline-block;
    color: #00ff41;
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid #00ff41;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.back-link:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Breadcrumb Navigation */
.breadcrumb {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.breadcrumb a {
    color: #00ffaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #00ff41;
    text-decoration: underline;
}

.breadcrumb span {
    color: #00ff41;
}