/* Custom CSS for Free Website Portal */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --purple-color: #8b5cf6;
    
    --font-family: 'Inter', sans-serif;
    --border-radius: 0.5rem;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
}

/* Custom Bootstrap Colors */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
}

.text-purple {
    color: var(--purple-color) !important;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

.btn-purple {
    background-color: var(--purple-color) !important;
    border-color: var(--purple-color) !important;
    color: white !important;
}

.btn-purple:hover {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}

.btn-outline-purple {
    color: var(--purple-color) !important;
    border-color: var(--purple-color) !important;
}

.btn-outline-purple:hover {
    background-color: var(--purple-color) !important;
    border-color: var(--purple-color) !important;
    color: white !important;
}

.badge.bg-purple {
    color: white;
}

/* Navigation */
.navbar {
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-image {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Feature Cards */
.feature-card {
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.feature-icon {
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Tutorial Cards */
.tutorial-card {
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.tutorial-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tutorial-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.1) 0%, rgba(255,255,255,0.1) 100%);
}

/* Category Cards */
.category-card {
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.category-icon {
    transition: var(--transition);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #f0fdfa;
    color: #065f46;
    border-left-color: var(--info-color);
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: var(--border-radius);
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #0f172a 100%);
}

footer a:hover {
    color: var(--warning-color) !important;
}

.newsletter-form .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.newsletter-form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-pattern {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(0,0,0,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23pattern)"/></svg>');
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    
    .feature-card,
    .tutorial-card,
    .category-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Article Content Styling */
.article-content {
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.article-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.article-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #64748b;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Search Results */
.search-highlight {
    background-color: #fef3c7;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 0.2rem;
    border: 1px solid #d1d5db;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: #f8fafc;
    border-color: var(--primary-color);
}

/* Admin Panel Styles */
.admin-sidebar {
    background: var(--dark-color);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-stats-card {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    border-radius: var(--border-radius);
}

/* Comment System */
.comment {
    border-left: 3px solid #e2e8f0;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment.reply {
    margin-left: 2rem;
    border-left-color: var(--primary-color);
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    color: #64748b;
    font-size: 0.9rem;
}

/* Old School CAPTCHA Styles */
.old-school-captcha {
    margin: 20px 0;
}

.captcha-box {
    background: #1a1a1a;
    border: 3px solid #00ff00;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3),
                inset 0 0 20px rgba(0, 255, 0, 0.1);
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
}

.captcha-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.05) 0px,
        rgba(0, 255, 0, 0.05) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

.captcha-header {
    background: #00ff00;
    color: #000;
    padding: 8px 12px;
    margin: -20px -20px 15px -20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    border-bottom: 2px solid #00cc00;
    box-shadow: 0 2px 10px rgba(0, 255, 0, 0.5);
}

.captcha-header i {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.captcha-math-question {
    text-align: center;
    padding: 30px 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 2px dashed #00ff00;
    border-radius: 5px;
    margin-bottom: 15px;
}

.math-display {
    font-size: 32px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00,
                 0 0 20px #00ff00;
    letter-spacing: 5px;
    font-weight: bold;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        text-shadow: 0 0 10px #00ff00,
                     0 0 20px #00ff00;
    }
    50% { 
        text-shadow: 0 0 20px #00ff00,
                     0 0 30px #00ff00,
                     0 0 40px #00ff00;
    }
}

.captcha-image-wrapper {
    text-align: center;
    padding: 15px;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    border-radius: 5px;
    margin-bottom: 15px;
}

.captcha-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.captcha-input-group {
    margin-bottom: 15px;
}

.captcha-input-group label {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.captcha-input {
    background: #000 !important;
    border: 2px solid #00ff00 !important;
    color: #00ff00 !important;
    font-family: 'Courier New', monospace !important;
    font-size: 18px !important;
    text-align: center;
    font-weight: bold;
    padding: 12px !important;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
}

.captcha-input:focus {
    outline: none !important;
    border-color: #00ff00 !important;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6),
                inset 0 0 10px rgba(0, 255, 0, 0.3) !important;
    background: #0a0a0a !important;
}

.captcha-input::placeholder {
    color: #006600 !important;
}

.captcha-footer {
    text-align: center;
    color: #00cc00;
    font-size: 12px;
    padding: 10px;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.captcha-footer i {
    margin-right: 5px;
}

/* Retro terminal effect */
.captcha-box::after {
    content: '█';
    position: absolute;
    top: 10px;
    right: 10px;
    color: #00ff00;
    font-size: 12px;
    animation: blink 1s infinite;
}

/* Alternative amber/orange theme (uncomment to use) */
/*
.captcha-box.amber-theme {
    border-color: #ff9900;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
}

.amber-theme .captcha-header {
    background: #ff9900;
}

.amber-theme .math-display,
.amber-theme .captcha-input-group label,
.amber-theme .captcha-input {
    color: #ff9900 !important;
    border-color: #ff9900 !important;
}
*/

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .alert,
    .captcha-container {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .article-content {
        color: black;
    }
}
