/* Custom styles for Multilayer Perceptrons slides */

/* Activation function demo containers */
.activation-demo {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
}

.activation-demo h4 {
    color: #10099F;
    margin-top: 15px;
    margin-bottom: 10px;
}

.activation-demo .demo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    position: relative;
    z-index: 100;
}

.activation-demo .demo-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: bold;
    color: #262626;
}

.activation-demo .demo-controls input[type="range"] {
    width: 200px;
    cursor: pointer;
}

.activation-demo .demo-controls span {
    font-family: 'Source Code Pro', monospace;
    color: #10099F;
    font-weight: bold;
    min-width: 180px;
    text-align: left;
}

/* Two-column layout for plots */
.two-column {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    margin: 20px 0;
}

.two-column .column {
    flex: 1;
    padding: 0 10px;
}

.two-column h4, .two-column h5 {
    color: #10099F;
    margin-bottom: 10px;
}

.two-column ul {
    text-align: left;
}

/* Grid layouts */
.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px auto;
    max-width: 800px;
}

.grid-2x2 > div {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #10099F;
}

.grid-2x2 h4 {
    color: #10099F;
    margin-bottom: 8px;
    font-size: 1.1em;
}

/* Comparison table */
.comparison-table {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparison-table th {
    background: #10099F;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
}

.comparison-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #EEEEEE;
}

.comparison-table td:first-child {
    font-weight: bold;
    background: #f9f9f9;
}

.comparison-table tr:hover td {
    background: #f0f0f0;
}

/* Timeline styles */
.timeline {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f9f9f9, white);
    border-radius: 10px;
}

.timeline > div {
    margin: 15px 0;
    padding: 10px 15px;
    border-left: 3px solid #10099F;
    background: white;
    border-radius: 0 5px 5px 0;
    transition: transform 0.3s ease;
}

.timeline > div:hover {
    transform: translateX(5px);
}

.timeline strong {
    color: #10099F;
}

/* Summary grid */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px auto;
    max-width: 900px;
}

.summary-grid > div {
    padding: 15px;
    background: white;
    border: 2px solid #EEEEEE;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.summary-grid > div:hover {
    border-color: #10099F;
    box-shadow: 0 4px 8px rgba(16, 9, 159, 0.1);
}

.summary-grid h4 {
    color: #10099F;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.summary-grid ul {
    text-align: left;
    font-size: 0.9em;
}

/* Next topics cards */
.next-topics {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px auto;
    max-width: 600px;
}

.next-topics > div {
    padding: 15px;
    background: linear-gradient(135deg, #f9f9f9, white);
    border-left: 4px solid #2DD2C0;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.next-topics > div:hover {
    transform: translateX(10px);
}

.next-topics h4 {
    color: #10099F;
    margin-bottom: 5px;
}

.next-topics p {
    font-size: 0.9em;
    color: #666;
}

/* Math equations styling */
.reveal .slides section .MathJax {
    font-size: 1.1em;
}

.reveal .slides section .MathJax_Display {
    margin: 0.5em 0;
}

/* Code blocks */
.reveal pre {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 5px;
    margin: 15px auto;
    max-width: 90%;
}

.reveal pre code {
    padding: 15px;
    line-height: 1.4;
    font-size: 0.85em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .two-column {
        flex-direction: column;
    }
    
    .grid-2x2,
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .activation-demo .demo-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .activation-demo .demo-controls input[type="range"] {
        width: 100%;
    }
}

/* SVG styling for plots */
.activation-demo svg {
    background: white;
    border: 1px solid #EEEEEE;
    border-radius: 5px;
}

.activation-demo svg text {
    font-size: 12px;
    fill: #262626;
}

.activation-demo svg .tick text {
    font-size: 10px;
}

.activation-demo svg .domain {
    stroke: #666;
}

.activation-demo svg .tick line {
    stroke: #ccc;
}

/* Fragment animations */
.reveal .slides section .fragment {
    transition: all 0.3s ease;
}

.reveal .slides section .fragment.visible {
    opacity: 1;
}

/* List styling */
.reveal .slides section ul {
    display: block;
    margin-left: 1em;
}

.reveal .slides section ol {
    display: block;
    margin-left: 1em;
}

.reveal .slides section ul li,
.reveal .slides section ol li {
    margin-bottom: 0.5em;
}

/* Utility classes */
.mt-sm { margin-top: 10px !important; }
.mt-md { margin-top: 20px !important; }
.mt-lg { margin-top: 30px !important; }

/* D3 visualization specific */
#relu-plot path,
#sigmoid-plot path,
#tanh-plot path {
    stroke-linejoin: round;
    stroke-linecap: round;
}

#relu-derivative-plot path,
#sigmoid-derivative-plot path,
#tanh-derivative-plot path {
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Interactive points on plots */
.activation-demo circle {
    cursor: pointer;
    stroke: white;
    stroke-width: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}