/* Custom styles for CrustyRustacean Dev Blog */

:root {
    --primary-color: #ff6b35;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-muted: #2d3748;
    --text-dark: #000000;
    --border-radius: 12px;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 25px rgba(0, 0, 0, 0.15);
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

.display-4 {
    font-weight: 700;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 6px;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e9ecef;
    border-right: none;
    background-color: #f8f9fa;
}

.form-control:focus + .input-group-text,
.input-group-text + .form-control:focus {
    border-color: var(--primary-color);
}

/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Profile Page */
.profile-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow);
}

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    color: var(--primary-color) !important;
}

/* Article Cards */
.article-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.article-card:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.article-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-meta i {
    width: 16px;
    text-align: center;
}

.article-content,
.article-body {
    color: #212529;
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6,
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: #212529;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p,
.article-body p {
    color: #212529;
    margin-bottom: 1.5rem;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background: none;
    border-color: transparent transparent var(--primary-color) transparent;
    color: var(--primary-color);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #34495e 100%);
}

footer .social-links a {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

footer .social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    box-shadow: var(--shadow);
}

.alert-success {
    border-left-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

/* Loading Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem !important;
        margin-bottom: 2rem !important;
    }

    .display-4 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Markdown Content Styles */
.article-content, .article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 400;
}

.article-content h1, .article-body h1 { 
    font-size: 2.5rem;
    margin-top: 2.5rem; 
    margin-bottom: 1.5rem; 
    font-weight: 700;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.article-content h1:first-child, .article-body h1:first-child {
    margin-top: 0;
}

.article-content h2, .article-body h2 { 
    font-size: 2rem;
    margin-top: 2rem; 
    margin-bottom: 1rem; 
    font-weight: 600;
    color: var(--secondary-color);
}

.article-content h3, .article-body h3 { 
    font-size: 1.5rem;
    margin-top: 1.75rem; 
    margin-bottom: 0.75rem; 
    font-weight: 600;
    color: var(--secondary-color);
}

.article-content h4, .article-body h4, 
.article-content h5, .article-body h5, 
.article-content h6, .article-body h6 { 
    margin-top: 1.5rem; 
    margin-bottom: 0.5rem; 
    font-weight: 600;
    color: var(--secondary-color);
}

.article-content p, .article-body p { 
    margin-bottom: 1.25rem;
    text-align: justify;
}

.article-content ul, .article-body ul, 
.article-content ol, .article-body ol { 
    margin-bottom: 1.25rem; 
    padding-left: 2rem; 
}

.article-content li, .article-body li { 
    margin-bottom: 0.5rem; 
    line-height: 1.6;
}

.article-content li p, .article-body li p {
    margin-bottom: 0.5rem;
}

.article-content pre, .article-body pre { 
    background-color: #f8f9fa; 
    border: 1px solid #e9ecef; 
    border-radius: var(--border-radius); 
    padding: 1.5rem; 
    overflow-x: auto; 
    margin: 1.5rem 0; 
    box-shadow: var(--shadow);
    position: relative;
}

.article-content code, .article-body code { 
    background-color: #f1f3f4; 
    padding: 0.2rem 0.4rem; 
    border-radius: 4px; 
    font-size: 0.9em; 
    color: #d73a49;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.article-content pre code, .article-body pre code { 
    background-color: transparent; 
    padding: 0; 
    color: var(--text-dark);
    font-size: 0.95rem;
}

.article-content table, .article-body table { 
    width: 100%; 
    margin: 1.5rem 0; 
    border-collapse: collapse; 
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.article-content th, .article-body th, 
.article-content td, .article-body td { 
    padding: 0.75rem 1rem; 
    border: 1px solid #dee2e6;
    text-align: left;
}

.article-content th, .article-body th { 
    background-color: var(--primary-color); 
    color: white;
    font-weight: 600; 
    border-color: rgba(255, 255, 255, 0.2);
}

.article-content tr:nth-child(even), .article-body tr:nth-child(even) {
    background-color: #f8f9fa;
}

.article-content blockquote, .article-body blockquote { 
    border-left: 4px solid var(--primary-color); 
    padding: 1rem 1.5rem; 
    margin: 1.5rem 0; 
    font-style: italic; 
    background-color: #f8f9fa;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--shadow);
}

.article-content blockquote p, .article-body blockquote p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.article-content hr, .article-body hr { 
    margin: 3rem 0; 
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.article-content a, .article-body a { 
    color: var(--primary-color); 
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.article-content a:hover, .article-body a:hover { 
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.article-content img, .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Task list styles */
.article-content ul.task-list, .article-body ul.task-list {
    list-style: none;
    padding-left: 1.5rem;
}

.article-content .task-list-item, .article-body .task-list-item {
    margin-bottom: 0.5rem;
}

.article-content .task-list-item input[type="checkbox"], 
.article-body .task-list-item input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer,
    .social-links {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .article-content, .article-body {
        font-size: 11pt;
        line-height: 1.4;
    }

    .article-content pre, .article-body pre {
        border: 1px solid #ccc;
        background-color: #f5f5f5;
    }
}
