/* Divisibility and Primes Page Specific Styles */

/* Hero Section Enhancements */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 10% 20%, rgba(106, 17, 203, 0.1) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(37, 117, 252, 0.1) 0%, transparent 20%);
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Keyword Badges */
.badge-keyword {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.badge-keyword:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Canvas Container */
.canvas-container {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    border-radius: 10px;
}

.canvas-container:hover {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.canvas-container.animate-pulse {
    box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.7);
    animation: pulseBorder 1s infinite;
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(106, 17, 203, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
    }
}

/* Control Panel */
.control-panel {
    border-left: 4px solid #6a11cb;
    position: relative;
}

.control-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(106, 17, 203, 0.03) 25%, transparent 25%, transparent 75%, rgba(106, 17, 203, 0.03) 75%),
                linear-gradient(45deg, rgba(106, 17, 203, 0.03) 25%, transparent 25%, transparent 75%, rgba(106, 17, 203, 0.03) 75%);
    background-size: 20px 20px;
    z-index: 0;
}

.control-panel > * {
    position: relative;
    z-index: 1;
}

/* Calculator Cards */
.calculator-card {
    transition: all 0.3s ease;
    border-top: 3px solid #6a11cb;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(106, 17, 203, 0.15);
}

/* Result Sections */
.result-section {
    border-left: 3px solid #6a11cb;
    background: linear-gradient(to right, rgba(106, 17, 203, 0.05), transparent);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Comparison Cards */
.comparison-card {
    transition: all 0.3s ease;
    border-bottom: 3px solid #6a11cb;
}

.comparison-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(106, 17, 203, 0.1);
}

/* Export Card */
.export-card {
    border: 1px dashed #6a11cb;
    position: relative;
    overflow: hidden;
}

.export-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(106, 17, 203, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

/* DS Cards */
.ds-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #eee;
}

.ds-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
}

.ds-card:hover::before {
    height: 100%;
    opacity: 0.1;
    transition: all 0.5s ease;
}

/* Buttons */
.btn-primary {
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-learn {
    position: relative;
    overflow: hidden;
}

.btn-learn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-learn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Animate Button Specific Styling */
#animateBtn {
    background: linear-gradient(45deg, #ff6b6b, #ffa502) !important;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white !important;
}

#animateBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

#animateBtn.animate-pulse {
    animation: pulseButton 0.5s ease infinite;
}

@keyframes pulseButton {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Visualize Button Specific Styling */
#visualizeBtn {
    background: linear-gradient(45deg, #6a11cb, #2575fc) !important;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white !important;
}

#visualizeBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.3);
}

#visualizeBtn.animate-pulse {
    animation: pulseButton 0.5s ease infinite;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(50, 50);
        opacity: 0;
    }
}

/* Visualization Section */
.visualization-section {
    position: relative;
}

.visualization-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 20%);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .badge-keyword {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin: 3px;
    }
    
    .ds-card {
        margin-bottom: 20px;
    }
    
    .canvas-container {
        min-height: 250px;
    }
    
    .control-panel {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .ds-card {
        padding: 25px 20px;
    }
    
    .canvas-container {
        min-height: 200px;
    }
}

/* Animation Classes */
.animate-pulse {
    animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-bounce {
    animation: bounceAnimation 1s ease infinite;
}

@keyframes bounceAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-spin {
    animation: spinAnimation 2s linear infinite;
}

@keyframes spinAnimation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Interactive Elements */
.interactive-element {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: scale(1.02);
}

/* Highlight Effect */
.highlight {
    background: linear-gradient(120deg, rgba(106, 17, 203, 0.1), rgba(37, 117, 252, 0.1));
    border-radius: 5px;
    padding: 2px 5px;
    transition: all 0.3s ease;
}

.highlight:hover {
    background: linear-gradient(120deg, rgba(106, 17, 203, 0.2), rgba(37, 117, 252, 0.2));
}

/* Progress Indicators */
.progress-visualization {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    position: relative;
    overflow: hidden;
}

.progress-visualization::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}