/**
 * Demos Page Specific Styles
 * Extends Ion template for interactive demonstrations
 */

/* Demo Controls */
.demo-controls {
    background: #f9f9f9;
    padding: 2em;
    margin: 2em 0;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.demo-controls label {
    display: block;
    color: #666f77;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8em;
    margin-bottom: 0.5em;
}

.demo-controls textarea,
.demo-controls select,
.demo-controls input[type="text"] {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
}

.demo-controls textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    resize: vertical;
    min-height: 80px;
}

.demo-controls .input-hint {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    margin-top: 0.5em;
    margin-bottom: 0;
}

/* Plot Container */
.demo-plot {
    width: 100%;
    min-height: 400px;
    margin: 2em 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1em;
}

/* Results Panel */
.demo-results {
    background: #ffffff;
    border: 2px solid #629DD1;
    border-radius: 6px;
    padding: 2em;
    margin: 2em 0;
}

.demo-results h3 {
    color: #629DD1;
    margin-top: 0;
    border-bottom: 2px solid #629DD1;
    padding-bottom: 0.5em;
}

.gmm-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
    margin: 1.5em 0;
}

.result-component {
    background: #f9f9f9;
    padding: 1.5em;
    border-radius: 6px;
    border-left: 4px solid #629DD1;
}

.result-component h4 {
    margin-top: 0;
    color: #666f77;
    font-size: 1em;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.result-table td {
    padding: 0.5em 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-table td:first-child {
    color: #888;
    width: 50%;
}

.result-table td:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.result-table tr:last-child td {
    border-bottom: none;
}

/* Interpretation Section */
.interpretation {
    margin-top: 2em;
    padding: 1.5em;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #629DD1;
}

.interpretation h4 {
    margin-top: 0;
    color: #629DD1;
}

.interpretation ul {
    margin: 1em 0;
    padding-left: 1.5em;
}

.interpretation li {
    margin-bottom: 0.75em;
    line-height: 1.6em;
}

/* Info Box */
.demo-info-box {
    background: #f9f9f9;
    padding: 2em;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin: 2em 0;
}

.demo-info-box h4 {
    color: #666f77;
    margin-top: 0;
    border-bottom: 2px solid #629DD1;
    padding-bottom: 0.5em;
}

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

.demo-info-box ul li {
    padding-left: 1.5em;
    margin-bottom: 1em;
    position: relative;
}

.demo-info-box ul li:before {
    content: "▸";
    color: #629DD1;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Button Enhancements for Demos */
.demo-controls .button {
    margin-top: 1em;
    box-sizing: border-box;
    max-width: 100%;
    padding: 0 1em;
    font-size: 0.85em;
    white-space: normal;
    line-height: 1.4em;
    height: auto;
    min-height: 2.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.demo-controls .button.fit {
    width: 100%;
}

@media screen and (max-width: 980px) {
    .demo-controls .button {
        font-size: 0.8em;
        padding: 0.75em;
    }
}

/* Loading State */
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled Button for Coming Soon */
.button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #888;
}

/* Coming Soon Section */
.coming-soon {
    margin-top: 4em;
    padding: 2em;
    background: #f9f9f9;
    border-left: 4px solid #629DD1;
    border-radius: 6px;
}

.coming-soon h3 {
    color: #629DD1;
    margin-top: 0;
}

.coming-soon ul {
    margin: 1em 0;
    padding-left: 2em;
}

.coming-soon li {
    margin-bottom: 0.5em;
}

/* Privacy Notice */
.privacy-notice {
    background: #fff9e6;
    border-left: 4px solid #f0ad4e;
    padding: 1em;
    margin: 1.5em 0;
    font-size: 0.9em;
    border-radius: 4px;
}

/* Responsive Adjustments */
@media screen and (max-width: 736px) {
    .demo-controls {
        padding: 1.5em;
    }

    .gmm-results-grid {
        grid-template-columns: 1fr;
    }

    .demo-plot {
        min-height: 300px;
        padding: 0.5em;
    }

    .result-table {
        font-size: 0.85em;
    }
}

/* Print Styles */
@media print {
    .demo-controls {
        display: none;
    }

    .demo-plot {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.demo-controls textarea:focus,
.demo-controls select:focus,
.demo-controls input:focus {
    border-color: #629DD1;
    box-shadow: 0 0 0 2px rgba(98, 157, 209, 0.2);
    outline: none;
}

/* Animation for Results Reveal */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#results-panel {
    animation: slideDown 0.3s ease-out;
}

/* Error States */
.input-error {
    border-color: #d9534f !important;
    box-shadow: 0 0 0 1px #d9534f !important;
}

.error-message {
    color: #d9534f;
    font-size: 0.85em;
    margin-top: 0.5em;
    display: none;
}

.error-message.show {
    display: block;
}

/* Demo Card Hover Effects */
.row.double .image.fit img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 6px;
}

.row.double .image.fit:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(98, 157, 209, 0.2);
}

/* Enhanced Plot Container */
.demo-plot {
    transition: box-shadow 0.3s ease;
}

.demo-plot:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Enhanced Results Panel */
.demo-results {
    box-shadow: 0 2px 12px rgba(98, 157, 209, 0.1);
}
