/* Identity Logic Grid Tool Styles */

/* Tool Container */
.tool-container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #0ff;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    color: #0ff;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.subtitle {
    color: #0cc;
    font-size: 1.1rem;
}

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

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

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

.breadcrumb span {
    color: #0cc;
}

/* Instructions Panel */
.instructions-panel {
    background: rgba(0, 40, 40, 0.8);
    border: 2px solid #0ff;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.instructions-toggle {
    width: 100%;
    background: rgba(0, 255, 255, 0.1);
    border: none;
    padding: 15px;
    color: #0ff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.instructions-toggle:hover {
    background: rgba(0, 255, 255, 0.2);
}

.toggle-icon {
    transition: transform 0.3s;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.instructions-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.instructions-content.open {
    max-height: 1000px;
    padding: 20px;
}

.instructions-content h3 {
    color: #0ff;
    margin-top: 0;
}

.instructions-content ol, .instructions-content ul {
    color: #0cc;
    line-height: 1.8;
}

.instructions-content li {
    margin: 10px 0;
}

.example-clues {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-left: 3px solid #0ff;
    margin-top: 15px;
}

.example-clues li {
    padding: 5px 0;
}

/* Grid Tool Box */
.grid-tool-box {
    background: rgba(0, 20, 20, 0.8);
    border: 2px solid #0ff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.grid-tool-box h2 {
    color: #0ff;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.8rem;
}

/* Grid Controls */
.grid-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.control-btn {
    background: linear-gradient(135deg, #0ff, #0aa);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: linear-gradient(135deg, #0dd, #099);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.control-btn.secondary {
    background: rgba(0, 255, 255, 0.2);
    color: #0ff;
    border: 1px solid #0ff;
}

.control-btn.secondary:hover {
    background: rgba(0, 255, 255, 0.3);
}

/* Grid Legend */
.grid-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-symbol {
    font-size: 1.5rem;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.legend-symbol.checkmark {
    background: rgba(0, 255, 0, 0.3);
    color: #0f0;
}

.legend-symbol.cross {
    background: rgba(255, 0, 0, 0.3);
    color: #f00;
}

.legend-symbol.empty {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0ff;
    color: #666;
}

.legend-label {
    color: #0cc;
    font-size: 0.9rem;
}

/* Grid Container */
.grid-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

/* Logic Grid Table */
.logic-grid {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.8);
    margin: 0 auto;
}

.logic-grid th,
.logic-grid td {
    border: 1px solid #0aa;
    padding: 15px;
    text-align: center;
    min-width: 100px;
}

.corner-cell {
    background: #000 !important;
    border: none !important;
}

.header-cell {
    background: rgba(0, 40, 40, 0.9);
    color: #0ff;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: text;
    transition: background 0.3s;
}

.header-cell:focus {
    outline: 2px solid #0ff;
    background: rgba(0, 60, 60, 0.9);
}

.header-cell:hover {
    background: rgba(0, 50, 50, 0.9);
}

/* Grid Cell States */
.grid-cell {
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.8rem;
    font-weight: bold;
    height: 80px;
    position: relative;
    user-select: none;
}

.grid-cell:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3);
}

.grid-cell[data-state="empty"] {
    background: rgba(0, 0, 0, 0.6);
    color: transparent;
}

.grid-cell[data-state="yes"]::after {
    content: "✓";
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    animation: checkmark-pop 0.3s ease;
}

.grid-cell[data-state="yes"] {
    background: rgba(0, 255, 0, 0.2);
}

.grid-cell[data-state="no"]::after {
    content: "✗";
    color: #f00;
    text-shadow: 0 0 10px #f00;
    animation: cross-pop 0.3s ease;
}

.grid-cell[data-state="no"] {
    background: rgba(255, 0, 0, 0.2);
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cross-pop {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(180deg);
    }
}

/* Grid Hint */
.grid-hint {
    text-align: center;
    color: #0cf;
    font-style: italic;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 200, 255, 0.1);
    border-radius: 5px;
}

/* Features Section */
.features-section {
    background: rgba(0, 20, 20, 0.6);
    border: 1px solid #0aa;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.features-section h3 {
    color: #0ff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

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

.feature-card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0aa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-card h4 {
    color: #0ff;
    margin: 10px 0;
    font-size: 1.2rem;
}

.feature-card p {
    color: #0cc;
    line-height: 1.6;
    margin: 0;
}

/* SEO Content */
.seo-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.seo-content h2, .seo-content h3 {
    color: #0ff;
    margin-top: 20px;
}

.seo-content p {
    color: #0cc;
    line-height: 1.8;
    margin: 15px 0;
}

/* Tool Navigation */
.tool-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
}

.nav-btn {
    background: rgba(0, 255, 255, 0.2);
    color: #0ff;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #0ff;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #0aa;
    font-size: 0.9rem;
}

/* Print Styles */
@media print {
    #matrix,
    #matrix-controls,
    .breadcrumb,
    .grid-controls,
    .features-section,
    .seo-content,
    .tool-navigation,
    footer {
        display: none !important;
    }
    
    .tool-container {
        max-width: 100%;
    }
    
    .grid-tool-box {
        border: 2px solid #000;
    }
    
    .logic-grid th,
    .logic-grid td {
        border: 1px solid #000;
        color: #000;
    }
    
    .header-cell {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 10px;
    }
    
    .grid-tool-box {
        padding: 15px;
    }
    
    .logic-grid th,
    .logic-grid td {
        padding: 10px;
        min-width: 70px;
        font-size: 0.9rem;
    }
    
    .grid-cell {
        height: 60px;
        font-size: 1.5rem;
    }
    
    .grid-controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}