/* Graph Calculator Wrapper */
.graph-calculator-wrapper {
    margin-top: 2rem;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel Styles */
.controls-panel,
.visualization-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.panel-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Control Sections */
.control-section {
    margin-bottom: 1.25rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.label-icon {
    font-size: 1rem;
}

.control-select,
.control-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

.control-select:focus,
.control-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.control-select:hover,
.control-input:hover {
    border-color: #d1d5db;
}

/* Node Inputs */
.node-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .node-inputs {
        grid-template-columns: 1fr;
    }
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

.action-btn.primary:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: #f9fafb;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.action-btn.secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    font-weight: 500;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    width: 100%;
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    margin-bottom: 1rem;
}

#graph-canvas {
    display: block;
    width: 100%;
    height: 500px;
    cursor: crosshair;
    background: #ffffff;
}

@media (max-width: 768px) {
    #graph-canvas {
        height: 400px;
    }
}

@media (max-width: 640px) {
    #graph-canvas {
        height: 300px;
    }
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.canvas-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
}

.overlay-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

.overlay-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Canvas Instructions */
.canvas-instructions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.instruction-icon {
    font-size: 1rem;
}

/* Info Panels */
.info-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .info-panels {
        grid-template-columns: 1fr;
    }
}

.properties-panel,
.matrix-panel,
.results-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.properties-panel .panel-title,
.matrix-panel .panel-title,
.results-panel .panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
}

/* Properties Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.property-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.property-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.property-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.property-content {
    flex: 1;
    min-width: 0;
}

.property-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.property-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

/* Matrix Container */
.matrix-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 0.875rem;
}

.matrix-table th,
.matrix-table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    min-width: 45px;
}

.matrix-table th {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    font-weight: 600;
}

.matrix-table td {
    background: #ffffff;
    color: #111827;
}

.matrix-table tr:nth-child(even) td {
    background: #f9fafb;
}

/* Results Container */
.results-container {
    margin-top: 1rem;
    min-height: 100px;
}

.result-content {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.result-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
}

.result-content ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #374151;
}

.result-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-text {
    font-size: 0.9375rem;
    color: #9ca3af;
    margin: 0;
}

/* Educational Content */
.educational-content {
    margin-top: 3rem;
}

.content-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #6366f1;
}

.content-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 1rem 0;
}

.content-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #4b5563;
    margin: 0 0 1rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.info-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

.graph-types,
.algorithm-list,
.applications-grid {
    margin: 1rem 0 0 0;
    padding: 0;
    list-style: none;
}

.type-item,
.application-item {
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
}

.algorithm-list {
    list-style: disc;
    padding-left: 1.5rem;
}

.algorithm-list li {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .controls-panel,
    .visualization-panel,
    .properties-panel,
    .matrix-panel,
    .results-panel {
        padding: 1rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .content-title {
        font-size: 1.25rem;
    }

    .content-subtitle {
        font-size: 1.125rem;
    }

    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid,
    .applications-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
