/**
 * Beaufort Cipher Tool Styles
 * Public free tool - SEO friendly
 * Vibrant Matrix-themed design
 */

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #0f0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Matrix Canvas Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Matrix Controls */
#matrix-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

#matrix-controls:hover {
    opacity: 1;
}

.matrix-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s;
    font-weight: bold;
}

.matrix-control-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

/* Container */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

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

.tool-header h1 {
    color: #f0f;
    font-size: 48px;
    margin: 0 0 10px 0;
    text-shadow: 0 0 10px #f0f, 0 0 20px #f0f;
}

.subtitle {
    color: #0f0;
    font-size: 18px;
    margin: 0;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite;
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

/* Breadcrumb */
.breadcrumb {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

.breadcrumb a:hover {
    color: #ffd700;
}

.breadcrumb span {
    color: #0f0;
}

/* Tool Box */
.tool-box {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #f0f;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(200, 0, 255, 0.15));
    border: 2px solid #f0f;
    border-radius: 8px;
    color: #f0f;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.3), rgba(200, 0, 255, 0.4));
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
    transform: translateY(-3px);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.4), rgba(255, 0, 200, 0.5));
    border-color: #ff00ff;
    color: #fff;
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.8), inset 0 0 20px rgba(255, 0, 255, 0.3);
    animation: pulse-glow-magenta 2s infinite;
}

@keyframes pulse-glow-magenta {
    0%, 100% {
        box-shadow: 0 0 25px rgba(255, 0, 255, 0.8), inset 0 0 20px rgba(255, 0, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 0, 255, 1), inset 0 0 25px rgba(255, 0, 255, 0.5);
    }
}

/* Input Groups */
.input-group, .output-group {
    margin-bottom: 25px;
}

.input-group label, .output-group label {
    display: block;
    color: #f0f;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Key Input */
.key-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd700;
    border-radius: 8px;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.key-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: rgba(0, 0, 0, 0.9);
}

.key-input::placeholder {
    color: rgba(255, 215, 0, 0.5);
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

.key-info {
    color: #ffd700;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

/* Text Areas */
.input-group textarea, .output-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0f0;
    border-radius: 8px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group textarea:focus, .output-group textarea:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.9);
}

/* Process Toggle Button */
.process-toggle {
    text-align: center;
    margin: 25px 0;
}

.toggle-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.2), rgba(0, 150, 255, 0.3));
    border: 2px solid #0cf;
    border-radius: 8px;
    color: #0cf;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.4), rgba(0, 150, 255, 0.5));
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.6);
}

/* Process Display */
.process-display {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0cf;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    animation: slideDown 0.3s ease-out;
}

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

.process-display h4 {
    color: #0cf;
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 20px;
}

.process-step {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid #0cf;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.step-label {
    color: #0cf;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    display: block;
}

/* Alignment Box */
.alignment-box {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 15px;
}

.alignment-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.alignment-label {
    color: #ffd700;
    font-weight: bold;
    min-width: 150px;
    font-size: 14px;
}

.alignment-row code {
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 3px;
    flex: 1;
}

/* Calculation Grid */
.calculation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.calc-box {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #0cf;
    border-radius: 5px;
    padding: 12px;
    transition: all 0.3s ease;
}

.calc-box:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 12px;
}

.calc-label {
    color: #0cf;
}

.calc-value {
    color: #0f0;
    font-weight: bold;
}

.calc-formula {
    color: #ffd700;
    font-size: 11px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

.calc-result {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 215, 0, 0.5);
}

/* Formula Box */
.formula-box {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 15px;
}

.formula-item {
    margin: 10px 0;
}

.formula-label {
    color: #ffd700;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.formula-item code {
    color: #0f0;
    font-size: 14px;
    display: block;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
}

.formula-note {
    color: #0cf;
    font-size: 13px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 255, 255, 0.1);
    border-left: 3px solid #0cf;
    border-radius: 3px;
}

/* Copy Button */
.copy-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.3), rgba(255, 50, 0, 0.4));
    border: 2px solid #ff6600;
    border-radius: 8px;
    color: #ff6600;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 15px auto 0;
}

.copy-btn:hover {
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.5), rgba(255, 50, 0, 0.6));
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.7);
    transform: scale(1.05);
}

/* Info Section */
.tool-info {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0f0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.tool-info h2 {
    color: #f0f;
    font-size: 24px;
    margin-bottom: 15px;
}

.tool-info h3 {
    color: #ffd700;
    font-size: 18px;
    margin: 20px 0 10px 0;
}

.tool-info p {
    color: #0f0;
    line-height: 1.8;
    margin-bottom: 15px;
}

.tool-info ul {
    color: #0f0;
    margin-left: 20px;
    line-height: 1.8;
}

.tool-info strong {
    color: #0cf;
}

/* Examples Section */
.examples {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #0f0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.example-text {
    color: #0cf;
    font-family: 'Courier New', monospace;
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .calculation-grid {
        grid-template-columns: 1fr;
    }
    
    .alignment-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alignment-label {
        min-width: auto;
    }
}
/* Additional Styles for Educational Content */

/* Example Box */
.example-box {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0cf;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.example-box p {
    color: #0f0;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
}

.example-box strong {
    color: #ffd700;
    font-weight: bold;
}

.example-box ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.example-box ul li {
    color: #0cf;
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.example-box ul li:before {
    content: "▸";
    color: #ffd700;
    position: absolute;
    left: 0;
}

/* Process Display Enhancements */
.process-display {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0cf;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    animation: slideDown 0.3s ease-out;
}

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

.process-display h4 {
    color: #0cf;
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 20px;
}

/* Info Section Enhancements */
.info-section {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0cf;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    color: #0f0;
}

.info-section h2 {
    color: #0cf;
    margin: 0 0 20px 0;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.info-section h3 {
    color: #ffd700;
    margin: 25px 0 15px 0;
    font-size: 18px;
    text-transform: uppercase;
}

.info-section p {
    color: #0f0;
    line-height: 1.8;
    margin: 15px 0;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section ul li {
    color: #0f0;
    margin: 12px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.info-section ul li:before {
    content: "▸";
    color: #ffd700;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.info-section strong {
    color: #ffd700;
    font-weight: bold;
}