/* Custom Styles for DevOps Blog */

/* Modal Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* Custom Checkbox */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background-color: white;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.custom-checkbox:checked {
    background-color: #f97316;
    border-color: #f97316;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll Margin for Sections (to account for fixed header) */
#blog-section,
#career-section,
#contact-section {
    scroll-margin-top: 100px;
    padding-top: 20px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #f97316;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button Pulse Effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.btn-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Notification Toast */
.notification-toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Image Upload Preview */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ea580c;
}

/* Accordion Transition */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.accordion-content.open {
    max-height: 2000px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-danger {
    background-color: #ef4444;
    color: white;
}

.badge-info {
    background-color: #3b82f6;
    color: white;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Star Rating */
.star-icon {
    transition: all 0.2s ease;
}

.star-icon:hover {
    transform: scale(1.2);
}

/* Mobile Menu Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-menu {
    animation: slideDown 0.3s ease-out;
}

/* Focus Styles */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Disabled State */
button:disabled,
input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table Styles */
.table-hover tbody tr:hover {
    background-color: #fef3c7;
}

/* Underline Animation */
.underline-animation {
    position: relative;
    display: inline-block;
}

.underline-animation::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #f97316;
    transition: width 0.3s ease;
}

.underline-animation:hover::after {
    width: 100%;
}

/* Notification Badge Animation */
@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

#notification-badge {
    animation: notificationPulse 2s ease-in-out infinite;
}

/* Notification Dropdown */
#notifications-dropdown {
    animation: fadeIn 0.2s ease-out;
}

.notification-item {
    transition: all 0.2s ease;
}

.notification-item:hover {
    background-color: #fff7ed !important;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Notification Unread Indicator */
.notification-item .w-2.h-2 {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Medium-Style Blog Post Styles */
.prose {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    color: #374151;
}

.prose h1, .prose h2, .prose h3 {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

.prose h2 {
    font-size: 2rem;
    line-height: 1.3;
}

.prose h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

.prose a {
    color: #f97316;
    text-decoration: underline;
}

.prose a:hover {
    color: #ea580c;
}

.prose img {
    border-radius: 0.5rem;
    margin: 2rem 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.prose blockquote {
    border-left: 4px solid #f97316;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6b7280;
}

.prose pre {
    background-color: #282c34;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #ef4444;
    font-family: 'Courier New', monospace;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: #abb2bf;
}

.prose ul, .prose ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

/* Clap Animation */
@keyframes clapPing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.clap-emoji {
    animation: clapPing 0.6s ease-out;
}

/* Reading Progress Bar */
#reading-progress {
    transition: width 0.1s ease-out;
}

/* Line Clamp for Related Posts */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Enhanced code block styling - VERY SPECIFIC */
pre,
.prose pre {
    position: relative !important;
    background-color: #1e1e1e !important;
    border-radius: 0.5rem !important;
    margin: 2rem 0 !important;
    max-height: 500px !important; /* Maksimum yükseklik */
    overflow: auto !important; /* Hem dikey hem yatay scroll */
    padding: 0 !important;
}

/* Admin paneli için farklı ayar */
.ql-editor pre,
.ql-snow .ql-editor pre {
    position: relative !important;
    background-color: #1e1e1e !important;
    border-radius: 0.5rem !important;
    margin: 2rem 0 !important;
    overflow: visible !important; /* Admin'de overflow visible */
    padding: 0 !important;
}

pre code,
pre code.hljs,
.prose pre code,
code[class*="language-"],
pre[class*="language-"] code {
    display: block !important;
    padding: 1.5rem !important;
    padding-top: 3rem !important; /* Kopyala butonu için alan */
    border-radius: 0.5rem !important;
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    white-space: pre !important; /* pre - scroll ile */
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    line-height: 1.6 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    tab-size: 4 !important;
    max-height: 500px !important; /* Maksimum yükseklik - OKUYUCU */
    overflow-y: auto !important; /* Dikey scroll */
    overflow-x: auto !important; /* Yatay scroll */
}

/* Okuyucu kod bloğu scrollbar - pre ve code için */
pre::-webkit-scrollbar,
pre code::-webkit-scrollbar,
pre code.hljs::-webkit-scrollbar,
.prose pre::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

pre::-webkit-scrollbar-track,
pre code::-webkit-scrollbar-track,
pre code.hljs::-webkit-scrollbar-track,
.prose pre::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 5px;
}

pre::-webkit-scrollbar-thumb,
pre code::-webkit-scrollbar-thumb,
pre code.hljs::-webkit-scrollbar-thumb,
.prose pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

pre::-webkit-scrollbar-thumb:hover,
pre code::-webkit-scrollbar-thumb:hover,
pre code.hljs::-webkit-scrollbar-thumb:hover,
.prose pre::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Quill Code Block - Special handling */
.ql-syntax,
pre.ql-syntax,
.ql-editor .ql-syntax {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    padding: 1.5rem !important;
    padding-top: 3rem !important;
    border-radius: 0.5rem !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    font-family: 'Courier New', Courier, monospace !important;
    line-height: 1.6 !important;
    display: block !important;
    overflow-x: auto !important;
}

/* Inline code (değil, sadece bloklar) */
:not(pre) > code {
    background-color: #f3f4f6 !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.25rem !important;
    font-size: 0.9em !important;
    color: #ef4444 !important;
}

/* Copy button for code blocks */
.code-copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #2d2d2d;
    color: #d4d4d4;
    border: 1px solid #404040;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.code-copy-button:hover {
    background-color: #3d3d3d;
    border-color: #f97316;
}

.code-copy-button.copied {
    background-color: #16a34a;
    border-color: #16a34a;
    color: white;
}

/* Custom selection color */
::selection {
    background-color: #fed7aa;
    color: #111827;
}

/* Sticky actions shadow */
#sticky-actions {
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Responsive typography */
@media (max-width: 768px) {
    .prose p {
        font-size: 1rem;
    }
    
    .prose h1 {
        font-size: 2rem;
    }
    
    .prose h2 {
        font-size: 1.75rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
}

/* Quill Editor Styles */
.ql-toolbar {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.ql-container {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    font-size: 16px;
}

.ql-editor {
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
}

.ql-editor h1 {
    font-size: 2.5rem;
}

.ql-editor h2 {
    font-size: 2rem;
}

.ql-editor h3 {
    font-size: 1.5rem;
}

.ql-snow .ql-picker {
    font-size: 14px;
}

/* Quill Editor'deki kod bloklarını düzelt - ADMIN PANELİ */
.ql-editor pre.ql-syntax {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    white-space: pre !important; /* pre-wrap yerine pre - taşmasın */
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    max-height: 400px !important; /* Maksimum yükseklik */
    min-height: 80px !important; /* Minimum yükseklik */
    overflow-y: auto !important; /* Dikey scroll */
    overflow-x: auto !important; /* Yatay scroll */
    margin: 1rem 0 !important;
    display: block !important;
}

/* Quill editöründeki kod bloğu scrollbar */
.ql-editor pre.ql-syntax::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ql-editor pre.ql-syntax::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.ql-editor pre.ql-syntax::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.ql-editor pre.ql-syntax::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Better focus states */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Animate-in effect for related posts */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#related-posts article {
    animation: slideInUp 0.6s ease-out;
}

#related-posts article:nth-child(1) {
    animation-delay: 0.1s;
}

#related-posts article:nth-child(2) {
    animation-delay: 0.2s;
}

#related-posts article:nth-child(3) {
    animation-delay: 0.3s;
}

/* Quill Editor - Görsel Hizalama Desteği */
.ql-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

/* Görselleri ortala */
.ql-editor .ql-align-center img,
.ql-editor p.ql-align-center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Görselleri sağa hizala */
.ql-editor .ql-align-right img,
.ql-editor p.ql-align-right img {
    display: block;
    margin-left: auto;
    margin-right: 0;
}

/* Görselleri sola hizala */
.ql-editor .ql-align-left img,
.ql-editor p.ql-align-left img,
.ql-editor img[style*="float: left"] {
    display: block;
    margin-left: 0;
    margin-right: auto;
}

/* Post.html için de aynı stiller */
.prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
}

.prose .ql-align-center img,
.prose p.ql-align-center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.prose .ql-align-right img,
.prose p.ql-align-right img {
    display: block;
    margin-left: auto;
    margin-right: 0;
}

.prose .ql-align-left img,
.prose p.ql-align-left img {
    display: block;
    margin-left: 0;
    margin-right: auto;
}

/* Yan yana görsel desteği - Float kullanarak */
.ql-editor img[style*="float: left"],
.prose img[style*="float: left"] {
    float: left;
    margin: 0.5rem 1rem 1rem 0;
    max-width: 48%;
}

.ql-editor img[style*="float: right"],
.prose img[style*="float: right"] {
    float: right;
    margin: 0.5rem 0 1rem 1rem;
    max-width: 48%;
}

/* Clear float sonrası */
.ql-editor p:has(+ p),
.prose p:has(+ p) {
    clear: both;
}

/* Kategori Badge Stilleri */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Kategori Renkleri */
.category-devops {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-cloud {
    background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
    color: white;
}

.category-kubernetes {
    background: linear-gradient(135deg, #326ce5 0%, #1a4d9e 100%);
    color: white;
}

.category-automation {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.category-programming {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

.category-security {
    background: linear-gradient(135deg, #f43b47 0%, #453a94 100%);
    color: white;
}

.category-monitoring {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.category-database {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.category-networking {
    background: linear-gradient(135deg, #fa8bff 0%, #2bd2ff 90%);
    color: white;
}

.category-career {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.category-tutorial {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.category-tools {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: white;
}

.category-lifestyle {
    background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%);
    color: #333;
}

.category-opinion {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.category-news {
    background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
    color: white;
}

.category-other {
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    color: #333;
}

/* Kategori Filtre Butonları */
.category-filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
}

.category-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-filter-btn.active {
    border-color: currentColor;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}