/* ===========================================
   SOLVESPHERE - ALGORITHMS STYLES
   Styles for algorithm visualization
=========================================== */

/* Algorithm Hero */
.algorithm-hero {
    padding: 120px 0 80px;
    background: var(--primary-gradient);
}

/* Algorithm Selection */
.algorithm-selection {
    background: var(--light-bg);
}

.algorithm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.algorithm-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.algorithm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background var(--transition-normal);
}

.algorithm-card.active::before {
    background: var(--primary-gradient);
}

.algorithm-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.algorithm-card.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: var(--shadow-glow);
}

.algorithm-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.algorithm-card h3 {
    font-size: 2rem;
    margin: 10px 0 5px;
    color: var(--text-dark);
    font-family: 'Orbitron', sans-serif;
}

.algorithm-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.algorithm-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.algorithm-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.algorithm-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.algorithm-stats .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.algorithm-stats .stat-value {
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Orbitron', sans-serif;
}

/* Algorithm Visualization */
.algorithm-visualization {
    background: var(--dark-bg);
    color: var(--text-light);
}

.visualization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.visualization-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.control-group input[type="range"] {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
}

.control-group span {
    min-width: 80px;
    color: var(--text-light);
    font-weight: 500;
}

.visualization-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .visualization-container {
        grid-template-columns: 1fr;
    }
}

.graph-container {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.algorithm-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 1.2rem;
}

.info-card h3 i {
    color: var(--primary-color);
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.info-item .value {
    color: var(--text-light);
    font-weight: 500;
    font-family: 'Orbitron', sans-serif;
}

.steps-container {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.steps-container::-webkit-scrollbar {
    width: 6px;
}

.steps-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.steps-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.step {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    border-left: 3px solid var(--primary-color);
    animation: fadeIn 0.3s ease-out;
}

.step:last-child {
    margin-bottom: 0;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-color.start {
    background: #10b981;
}

.legend-color.end {
    background: #ef4444;
}

.legend-color.visited {
    background: #3b82f6;
}

.legend-color.path {
    background: #f59e0b;
}

.legend-color.wall {
    background: #64748b;
}

/* Algorithm Explanation */
.algorithm-explanation {
    background: var(--light-bg);
}

.explanation-tabs {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.tab-buttons {
    display: flex;
    background: var(--dark-bg);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    border-bottom-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content {
    padding: 40px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.tab-pane > p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.algorithm-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.detail h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.detail h4 i {
    color: var(--primary-color);
}

.detail ol,
.detail ul {
    padding-left: 20px;
    color: var(--text-muted);
}

.detail li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.detail li strong {
    color: var(--text-dark);
}

.code-example {
    background: var(--dark-bg);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-top: 30px;
}

.code-example h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-light);
}

.code-example h4 i {
    color: var(--accent-color);
}

.code-example pre {
    background: #1a202c;
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 0;
}

.code-example code {
    font-family: 'Courier New', monospace;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Comparison Table */
.comparison-section {
    background: var(--light-bg);
}

.comparison-table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table thead {
    background: var(--dark-bg);
}

.comparison-table th {
    padding: 20px;
    text-align: left;
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.comparison-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background var(--transition-fast);
}

.comparison-table tbody tr:hover {
    background: #f8fafc;
}

.comparison-table td {
    padding: 18px 20px;
    color: var(--text-dark);
}

.comparison-table td:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

.comparison-table .success {
    color: #10b981;
    font-size: 1.1rem;
}

.comparison-table .error {
    color: #ef4444;
    font-size: 1.1rem;
}

/* Team Styles (for team.html) */
.team-hero {
    padding: 120px 0 80px;
    background: var(--secondary-gradient);
}

.team-stats {
    background: var(--light-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
}

.team-members {
    background: var(--light-bg);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.member-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.member-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.member-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.member-card:hover .member-image img {
    transform: scale(1.05);
}

.member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.member-card:hover .member-overlay {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform var(--transition-normal), background var(--transition-normal);
}

.social-links a:hover {
    transform: translateY(-3px);
    background: var(--secondary-color);
}

.member-info {
    padding: 25px;
}

.member-name {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.member-role {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1rem;
}

.member-bio {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.member-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .algorithm-cards {
        grid-template-columns: 1fr;
    }
    
    .visualization-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .visualization-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        min-width: 120px;
        flex: none;
    }
    
    .comparison-table {
        overflow-x: auto;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
}