/**
 * Frequency Analysis Tool - Styles
 * Location: assets/css/frequency-analysis.css
 * Matrix Portal theme with cryptanalysis aesthetics
 */

/* ========================================
   TOOL CONTAINER
   ======================================== */

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 10;
}

/* ========================================
   HEADER
   ======================================== */

.tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: rgba(0, 20, 0, 0.7);
    border: 2px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.tool-header h1 {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
}

.tool-subtitle {
    font-size: 1.2em;
    color: #0ff;
    margin: 10px 0;
    opacity: 0.9;
}

.tool-badge {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #0f0;
    border-radius: 20px;
    font-size: 0.9em;
    color: #0ff;
    letter-spacing: 1px;
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */

.breadcrumb {
    margin-bottom: 20px;
    padding: 12px 20px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #0f0;
    border-radius: 5px;
    font-size: 0.95em;
}

.breadcrumb a {
    color: #0ff;
    text-decoration: none;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

.breadcrumb span {
    color: #0f0;
}

/* ========================================
   TOOL DESCRIPTION
   ======================================== */

.tool-description {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid #0f0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.tool-description h2 {
    color: #0f0;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
    text-shadow: 0 0 5px #0f0;
}

.tool-description p {
    color: #ccc;
    margin-bottom: 15px;
}

.use-cases {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border-left: 3px solid #0f0;
    border-radius: 5px;
}

.use-cases h3 {
    color: #0ff;
    margin-top: 0;
    margin-bottom: 12px;
}

.use-cases ul {
    margin: 0;
    padding-left: 20px;
}

.use-cases li {
    color: #ccc;
    margin-bottom: 8px;
}

.use-cases strong {
    color: #0f0;
}

/* ========================================
   MAIN TOOL BOX
   ======================================== */

.tool-box {
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid #0f0;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}

/* Info Banner */
.info-banner {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.info-banner span:not(.info-icon) {
    color: #0ff;
    font-size: 0.95em;
}

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

.input-group label {
    display: block;
    color: #0f0;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.input-group textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0f0;
    border-radius: 8px;
    color: #0ff;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    resize: vertical;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.1);
    transition: all 0.3s;
}

.input-group textarea:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3), inset 0 0 10px rgba(0, 255, 0, 0.2);
}

/* Character Count */
.char-count {
    margin-top: 8px;
    color: #0ff;
    font-size: 0.9em;
    text-align: right;
}

.char-count span {
    color: #0f0;
    font-weight: bold;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    background: rgba(0, 100, 0, 0.3);
    border: 2px solid #0f0;
    border-radius: 8px;
    color: #0ff;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
    transform: translateY(-2px);
}

.action-btn.primary-btn {
    background: rgba(0, 150, 0, 0.4);
    border-color: #0ff;
    color: #fff;
}

.action-btn.primary-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

.btn-icon {
    font-size: 1.2em;
}

/* ========================================
   RESULTS CONTAINER
   ======================================== */

.results-container {
    margin-top: 30px;
    padding: 25px;
    background: rgba(0, 50, 0, 0.4);
    border: 2px solid #0ff;
    border-radius: 10px;
}

.results-container h3 {
    margin: 0 0 20px 0;
    color: #0ff;
    font-size: 1.5em;
    text-shadow: 0 0 5px #0ff;
}

/* Tabs */
.results-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(0, 255, 0, 0.3);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #0f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #0ff;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(0, 255, 0, 0.1);
}

.tab-btn.active {
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Comparison Toggle */
.comparison-toggle {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 8px;
}

.comparison-toggle label {
    color: #0ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* ========================================
   FREQUENCY DISPLAYS
   ======================================== */

.frequency-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
}

.freq-letter {
    font-size: 1.5em;
    font-weight: bold;
    color: #0f0;
    min-width: 40px;
    text-align: center;
}

.freq-bar-container {
    flex: 1;
    position: relative;
}

.freq-bar-bg {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0f0;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.freq-bar {
    height: 100%;
    background: linear-gradient(90deg, #0f0, #0ff);
    border-radius: 5px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.freq-bar-value {
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
    text-shadow: 0 0 2px #fff;
}

.freq-comparison {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    min-width: 180px;
}

.freq-actual,
.freq-expected,
.freq-suggestion {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.9em;
}

.freq-actual {
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
    font-weight: bold;
}

.freq-expected {
    background: rgba(0, 255, 255, 0.1);
    color: #0ff;
}

.freq-suggestion {
    background: rgba(255, 165, 0, 0.2);
    color: #ff6600;
    font-weight: bold;
    border: 1px solid rgba(255, 102, 0, 0.5);
}

/* N-gram Results */
.ngram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.ngram-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    text-align: center;
}

.ngram-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #0f0;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.ngram-count {
    font-size: 0.9em;
    color: #0ff;
}

.ngram-percent {
    font-size: 0.85em;
    color: #ccc;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
}

.stat-label {
    color: #0ff;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.stat-value {
    color: #0f0;
    font-size: 1.5em;
    font-weight: bold;
}

.stat-detail {
    color: #ccc;
    font-size: 0.85em;
    margin-top: 5px;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid #0f0;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    line-height: 1.7;
}

.content-section h2 {
    color: #0f0;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 0 0 5px #0f0;
}

.content-section h3 {
    color: #0ff;
    margin-top: 25px;
    margin-bottom: 15px;
}

.content-section p {
    color: #ccc;
    margin-bottom: 15px;
}

.content-section ol,
.content-section ul {
    color: #ccc;
    margin-left: 25px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section strong {
    color: #0f0;
}

/* Frequency Table */
.frequency-table {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.freq-row {
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(0, 255, 0, 0.05);
    border-left: 3px solid #0ff;
    border-radius: 5px;
}

.freq-row:last-child {
    margin-bottom: 0;
}

.freq-row strong {
    color: #0ff;
    display: inline-block;
    min-width: 150px;
}

/* Warning Box */
.warning-box {
    background: rgba(255, 100, 0, 0.1);
    border: 2px solid #ff6600;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.warning-box strong {
    color: #ff6600;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.warning-box p {
    color: #ffaa66;
    margin: 0;
}

/* ========================================
   EXAMPLES SECTION
   ======================================== */

.examples-section {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid #0f0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.examples-section h2 {
    color: #0f0;
    margin-top: 0;
    margin-bottom: 25px;
    text-shadow: 0 0 5px #0f0;
}

.example-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.example-header h3 {
    color: #0ff;
    margin: 0;
}

.try-example-btn {
    padding: 8px 16px;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #0f0;
    border-radius: 5px;
    color: #0ff;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.try-example-btn:hover {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.example-content {
    margin-top: 15px;
}

.example-text {
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0f0;
    border-radius: 8px;
    color: #0ff;
    font-family: 'Courier New', monospace;
    margin-bottom: 12px;
}

.example-result {
    padding: 12px;
    background: rgba(0, 255, 255, 0.1);
    border-left: 3px solid #0ff;
    border-radius: 5px;
    color: #ccc;
    font-size: 0.95em;
}

.example-result strong {
    color: #0ff;
}

/* ========================================
   FAQ SECTION
   ======================================== */

.faq-section {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid #0f0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.faq-section h2 {
    color: #0f0;
    margin-top: 0;
    margin-bottom: 25px;
    text-shadow: 0 0 5px #0f0;
}

.faq-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.faq-item h3 {
    color: #0ff;
    margin-top: 0;
    margin-bottom: 12px;
}

.faq-item p {
    color: #ccc;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.faq-item ul {
    margin: 10px 0;
    padding-left: 20px;
}

.faq-item li {
    color: #ccc;
    margin-bottom: 5px;
}

.faq-item strong {
    color: #0f0;
}

/* ========================================
   RELATED TOOLS
   ======================================== */

.related-tools {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid #0f0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.related-tools h2 {
    color: #0f0;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 0 0 5px #0f0;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-tool-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #0f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.related-tool-card:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    transform: translateY(-5px);
}

.tool-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.related-tool-card h3 {
    color: #0ff;
    margin: 0 0 10px 0;
}

.related-tool-card p {
    color: #ccc;
    margin: 0;
    font-size: 0.9em;
}

/* ========================================
   FOOTER
   ======================================== */

.tool-footer {
    text-align: center;
    padding: 25px;
    border-top: 2px solid rgba(0, 255, 0, 0.3);
    color: #ccc;
}

.tool-footer p {
    margin: 8px 0;
}

.tool-footer a {
    color: #0ff;
    text-decoration: none;
    transition: all 0.3s;
}

.tool-footer a:hover {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .tool-container {
        padding: 20px 15px;
    }

    .tool-header h1 {
        font-size: 2em;
    }

    .tool-subtitle {
        font-size: 1em;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .results-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .freq-comparison {
        flex-direction: column;
        gap: 3px;
    }

    .ngram-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .example-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .try-example-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tool-header {
        padding: 20px 15px;
    }

    .tool-box {
        padding: 20px;
    }

    .frequency-item {
        flex-direction: column;
        gap: 8px;
    }

    .freq-letter {
        font-size: 1.2em;
    }

    .ngram-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}