/* CSS Variables for better theme management */
:root {
    /* Light Mode Colors */
    --bg-light: #f8f9fa;
    --bg-card-light: #ffffff;
    --text-primary-light: #333333;
    --text-secondary-light: #555555;
    --border-light: #e9ecef;
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
    --accent-light: #3a36e0;
    --accent-hover-light: #2a26d0;
    --tag-bg-light: #f1f3f5;
    --tag-text-light: #495057;
    
    /* Dark Mode Colors */
    --bg-dark: #121212;
    --bg-card-dark: #1e1e1e;
    --text-primary-dark: #e0e0e0;
    --text-secondary-dark: #b0b0b0;
    --border-dark: #333;
    --shadow-dark: 0 5px 15px rgba(0, 0, 0, 0.2);
    --accent-dark: #6c63ff;
    --accent-hover-dark: #5a52e0;
    --tag-bg-dark: #2d2d2d;
    --tag-text-dark: #e0e0e0;
}

/* Project Detail Page - Professional Redesign */
.project-showcase {
    background: linear-gradient(135deg, #3a36e0 0%, #5b4de3 100%);
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.project-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 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.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
}

.project-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: white;
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumbs .current {
    color: white;
    font-weight: 500;
}

/* Enhanced project title styling for light mode */
.project-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Animated highlight effect for the title */
.project-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Title hover effect in light mode */
.project-title:hover::after {
    width: 100%;
}

[dir="rtl"] .project-title::after {
    left: auto;
    right: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.9));
}

/* Make the title more visible on the gradient background */
.project-intro {
    position: relative;
    z-index: 2;
}

/* Add a subtle text glow in light mode */
@media (min-width: 768px) {
    .project-title {
        letter-spacing: -0.5px;
    }
    
    .project-title:hover {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.2);
    }
}

.project-category {
    margin-bottom: 1.5rem;
}

.category-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-summary {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.project-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    cursor: pointer;
}

.btn-primary {
    background-color: white;
    color: #3a36e0;
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-full {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #3a36e0;
    color: white;
}

.btn-full:hover {
    background-color: #332ec8;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-featured-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: perspective(1000px) rotateY(-5deg);
    transition: all 0.5s ease;
}

.project-featured-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.featured-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Main content section */
.project-content-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.project-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.project-main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-block {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.content-block h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #333;
    position: relative;
    padding-bottom: 0.75rem;
}

.content-block h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #3a36e0;
    border-radius: 3px;
}

.rich-text {
    line-height: 1.8;
    color: #555;
}

.device-preview-tabs {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    background-color: #f1f3f5;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #3a36e0;
    background-color: #e9ecef;
}

.tab-btn.active {
    color: #3a36e0;
    background-color: white;
    border-bottom: 3px solid #3a36e0;
}

.preview-container {
    padding: 2rem;
    background-color: white;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: center;
    min-height: 500px;
}

.preview-item {
    width: 100%;
    display: none;
    height: 100%;
}

.preview-item.active {
    display: flex;
    justify-content: center;
}

.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Sidebar Styles */
.project-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-widget h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #3a36e0;
    border-radius: 2px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-label {
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 600;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-tag {
    background-color: #f1f3f5;
    color: #495057;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.project-cta {
    text-align: center;
}

.project-cta p {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

/* Navigation */
.project-navigation {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: #495057;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    color: #3a36e0;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border: 5px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background-color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background-color: #f8f9fa;
    transform: rotate(90deg);
}

/* Device Preview Button */
.btn-preview {
    background-color: #2d2d2d;
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-preview:hover {
    background-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-preview:hover::before {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    margin: 2.5vh auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #dc3545;
}

.modal-body {
    padding: 0;
    overflow: auto;
    flex: 1;
    background-color: #f8f9fa;
}

/* New Device Preview Styles */
.device-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.device-tabs {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0 1rem;
}

.device-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.device-tab:hover {
    color: #3a36e0;
    background-color: rgba(58, 54, 224, 0.05);
}

.device-tab.active {
    color: #3a36e0;
}

.device-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #3a36e0;
}

.device-frames {
    flex: 1;
    position: relative;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
}

.device-frame {
    display: none;
    position: relative;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.device-frame.active {
    display: block;
}

.device-desktop {
    width: 100%;
    max-width: 1200px;
    height: calc(85vh - 140px);
    border: 1px solid #ddd;
}

.device-tablet {
    width: 768px;
    height: calc(85vh - 140px);
    max-height: 1024px;
    border: 15px solid #333;
    border-radius: 12px;
}

.device-mobile {
    width: 375px;
    height: calc(85vh - 140px);
    max-height: 667px;
    border: 18px solid #333;
    border-radius: 36px;
    position: relative;
}

.device-mobile::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 5px;
    background: #222;
    border-radius: 10px;
    z-index: 1;
}

.device-screen {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background-color: #fff;
}

.device-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    z-index: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(58, 54, 224, 0.2);
    border-radius: 50%;
    border-top-color: #3a36e0;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.device-error {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
}

.device-error i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.device-error p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #555;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .device-tablet {
        width: 600px;
    }
}

@media (max-width: 768px) {
    .modal-container {
        width: 98%;
        margin: 1vh auto;
        max-height: 98vh;
    }
    
    .device-tabs {
        padding: 0;
        justify-content: center;
    }
    
    .device-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .device-frames {
        padding: 1rem;
    }
    
    .device-desktop {
        height: calc(90vh - 130px);
    }
    
    .device-tablet {
        width: 500px;
        height: calc(90vh - 130px);
    }
    
    .device-mobile {
        width: 320px;
        height: calc(90vh - 130px);
    }
}

@media (max-width: 576px) {
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .device-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .device-tab i {
        margin-right: 5px;
    }
    
    .device-frames {
        padding: 0.5rem;
    }
    
    .device-tablet {
        width: 100%;
        height: calc(90vh - 120px);
        border-width: 10px;
    }
    
    .device-mobile {
        width: 300px;
        height: calc(90vh - 120px);
        border-width: 12px;
    }
    
    .device-mobile::before {
        width: 40px;
        height: 4px;
    }
}

/* Dark Mode Support */
body.dark-mode .modal-container,
body.dark-mode .device-tabs,
body.dark-mode .modal-header {
    background-color: #212529;
    border-color: #343a40;
}

body.dark-mode .modal-header h3 {
    color: #e9ecef;
}

body.dark-mode .device-tab {
    color: #adb5bd;
}

body.dark-mode .device-tab:hover {
    background-color: rgba(58, 54, 224, 0.15);
}

body.dark-mode .device-tab.active {
    color: #5b4de3;
}

body.dark-mode .device-frames {
    background-color: #343a40;
}

body.dark-mode .loading-indicator,
body.dark-mode .device-error {
    background-color: #343a40;
}

body.dark-mode .loading-indicator p,
body.dark-mode .device-error p {
    color: #adb5bd;
}

body.dark-mode .device-desktop {
    border-color: #495057;
}

/* RTL Support */
[dir="rtl"] .device-tab.active::after {
    right: 0;
    left: auto;
} 

/* --- Device Preview --- */
.device-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.device-preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-preview-modal.active .device-preview-overlay {
    opacity: 1;
}

.device-preview-container {
    width: 90%;
    height: 90%;
    background-color: #2c2c2e;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.device-preview-modal.active .device-preview-container {
    transform: scale(1);
    opacity: 1;
}

.device-preview-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #3a3a3c;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}

.device-preview-header h3 {
    color: #f5f5f7;
    font-size: 1rem;
    margin: 0;
    flex-grow: 1;
}

.device-preview-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background-color: #555;
    color: #f5f5f7;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.control-btn:hover {
    background-color: #666;
}

.control-btn.active {
    background-color: #0a84ff;
    color: white;
    transform: scale(1.1);
}

.device-preview-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0 10px;
    transition: color 0.2s ease;
}

.device-preview-close:hover {
    color: white;
}

.device-preview-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background-image: radial-gradient(circle, #444 0%, #2c2c2e 100%);
}

.device-viewport {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    background-color: #111;
}

.device-viewport iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background-color: #fff;
}

/* Device specific styles */
.device-viewport[data-device="desktop"] {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #111;
}

.device-viewport[data-device="tablet"] {
    width: 768px;
    height: 1024px;
    max-width: 90%;
    max-height: 90%;
    border-radius: 20px;
    border: 14px solid #111;
    padding: 20px;
    box-sizing: content-box;
}

.device-viewport[data-device="mobile"] {
    width: 375px;
    height: 667px;
    max-width: 90%;
    max-height: 90%;
    border-radius: 40px;
    border: 16px solid #111;
    padding: 10px;
    box-sizing: content-box;
    position: relative;
}

.device-viewport[data-device="mobile"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 20px;
    background: #111;
    border-radius: 0 0 10px 10px;
}

/* Loader and Error States */
.device-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #0a84ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.device-error {
    color: #f5f5f7;
    text-align: center;
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .device-preview-header h3 {
        display: none;
    }
    .device-preview-controls {
        flex-grow: 1;
        justify-content: center;
    }
} 

/* Enhanced Responsive Styles */
@media (max-width: 1200px) {
    .project-title {
        font-size: 2.5rem;
    }
    
    .project-content-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .project-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-featured-image {
        transform: perspective(1000px) rotateY(0);
        max-width: 100%;
        margin: 0 auto;
    }
    
    .project-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .device-tablet {
        width: 450px;
        height: 650px;
    }
}

@media (max-width: 768px) {
    .project-showcase {
        padding: 40px 0;
    }
    
    .project-title {
        font-size: 2rem;
    }
    
    .project-summary {
        font-size: 1rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-container {
        width: 95%;
        max-width: 95%;
    }
    
    .device-tabs {
        flex-wrap: wrap;
    }
    
    .device-tab {
        padding: 0.75rem;
    }
    
    .device-frames {
        padding: 1rem;
    }
    
    .device-desktop {
        width: 100%;
    }
    
    .device-tablet {
        width: 350px;
        height: 500px;
    }
    
    .device-mobile {
        width: 220px;
        height: 450px;
    }
    
    .content-block {
        padding: 1.5rem;
    }
    
    .content-block h2 {
        font-size: 1.5rem;
    }
    
    .project-sidebar {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .breadcrumbs {
        font-size: 0.8rem;
        flex-wrap: wrap;
        line-height: 1.8;
    }
}

@media (max-width: 576px) {
    .project-showcase {
        padding: 30px 0;
    }
    
    .project-title {
        font-size: 1.75rem;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .device-tab {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .device-tab i {
        margin-right: 0;
    }
    
    .device-frames {
        padding: 0.75rem;
    }
    
    .device-tablet {
        width: 280px;
        height: 400px;
    }
    
    .device-mobile {
        width: 180px;
        height: 360px;
        border-width: 10px 5px;
    }
    
    .device-mobile::before {
        width: 40px;
        height: 5px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .project-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .content-block {
        padding: 1.25rem;
    }
    
    .sidebar-widget {
        padding: 1.25rem;
    }
    
    .tech-tags {
        flex-wrap: wrap;
    }
    
    .tech-tag {
        margin-bottom: 0.5rem;
    }
    
    .project-meta .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .device-preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .device-preview-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .device-viewport[data-device="mobile"] {
        width: 280px;
        height: 500px;
        border-width: 15px 8px;
    }
    
    .device-viewport[data-device="tablet"] {
        width: 90%;
        height: 500px;
    }
}

@media (max-width: 400px) {
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-featured-image {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .featured-image {
        border-radius: 0;
    }
    
    .device-viewport[data-device="mobile"] {
        width: 240px;
        height: 450px;
    }
    
    .breadcrumbs {
        font-size: 0.75rem;
    }
    
    .breadcrumbs .separator {
        margin: 0 0.3rem;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .content-block h2::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .device-tab.active::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .project-navigation .nav-btn i {
    transform: scaleX(-1);
} 

/* Mobile-specific styles */
.project-meta.mobile-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.project-meta.mobile-view .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.8rem 1rem;
}

/* Touch-friendly gallery for mobile */
@media (max-width: 768px) {
    .gallery-item {
        position: relative;
        overflow: hidden;
        cursor: pointer;
    }
    
    .gallery-item::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.2);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .gallery-item::before {
        content: '\f00e'; /* Font Awesome magnifying glass icon */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.8);
        color: white;
        font-size: 1.5rem;
        z-index: 2;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .gallery-item:active::after,
    .gallery-item:active::before {
        opacity: 1;
    }
    
    .gallery-item:active::before {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Fix for RTL on mobile */
@media (max-width: 768px) {
    [dir="rtl"] .project-meta.mobile-view .btn i {
        margin-left: 0.5rem;
        margin-right: 0;
    }
    
    [dir="rtl"] .breadcrumbs {
        justify-content: flex-start;
    }
} 

/* Improved device preview modal for mobile */
@media (max-width: 576px) {
    .device-preview-modal.active .device-preview-container {
        width: 95%;
        max-width: 95%;
        padding: 1rem;
    }
    
    .device-preview-header {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .device-preview-body {
        padding: 0.5rem;
    }
    
    .control-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .device-viewport[data-device="desktop"] {
        height: 60vh;
    }
    
    .device-viewport[data-device="tablet"] {
        width: 90%;
        height: 60vh;
        border-width: 20px 10px;
    }
    
    .device-viewport[data-device="mobile"] {
        width: 70%;
        height: 60vh;
        max-height: 500px;
    }
}

/* Fix for very small screens */
@media (max-width: 400px) {
    .device-viewport[data-device="mobile"] {
        width: 85%;
    }
    
    .device-preview-controls {
        gap: 0.25rem;
    }
    
    .control-btn {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
} 

/* Touch-friendly lightbox for mobile */
@media (max-width: 768px) {
    .lightbox-content {
        width: 90%;
        max-width: 90%;
        padding: 0.5rem;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
    
    /* Add swipe hint */
    .lightbox.active::after {
        content: '';
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 5px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 5px;
        opacity: 0.7;
        animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
        0% {
            opacity: 0.7;
            width: 50px;
        }
        50% {
            opacity: 0.9;
            width: 70px;
        }
        100% {
            opacity: 0.7;
            width: 50px;
        }
    }
} 

/* Dark Mode Styles */
body.dark-mode .project-showcase {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .project-title {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .project-title::after {
    background: linear-gradient(90deg, var(--accent-dark), rgba(108, 99, 255, 0.4));
}

body.dark-mode .project-title:hover::after {
    width: 100%;
    background: linear-gradient(90deg, var(--accent-dark), rgba(108, 99, 255, 0.6));
}

[dir="rtl"] body.dark-mode .project-title::after {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.4), var(--accent-dark));
}

body.dark-mode .project-title:hover {
    text-shadow: 0 0 20px rgba(108, 99, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .project-summary {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .category-tag {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .project-content-section {
    background-color: #121212;
}

body.dark-mode .content-block {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .content-block h2 {
    color: #e0e0e0;
}

body.dark-mode .rich-text {
    color: #b0b0b0;
}

body.dark-mode .project-sidebar .sidebar-widget {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .sidebar-widget h3 {
    color: #e0e0e0;
}

body.dark-mode .info-label {
    color: #a0a0a0;
}

body.dark-mode .info-value {
    color: #e0e0e0;
}

body.dark-mode .tech-tag {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .tech-tag:hover {
    background-color: var(--accent-dark);
    color: white;
}

body.dark-mode .project-navigation .nav-btn {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
}

body.dark-mode .project-navigation .nav-btn:hover {
    background-color: #2d2d2d;
}

body.dark-mode .lightbox {
    background-color: rgba(0, 0, 0, 0.9);
}

body.dark-mode .lightbox-content {
    background-color: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .lightbox-close {
    color: #e0e0e0;
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Device Preview in Dark Mode */
body.dark-mode .device-preview-modal .device-preview-overlay {
    background-color: rgba(0, 0, 0, 0.85);
}

body.dark-mode .device-preview-container {
    background-color: var(--bg-card-dark);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
}

body.dark-mode .device-preview-header {
    border-bottom: 1px solid var(--border-dark);
}

body.dark-mode .device-preview-header h3 {
    color: var(--text-primary-dark);
}

body.dark-mode .control-btn {
    color: var(--text-secondary-dark);
}

body.dark-mode .control-btn:hover {
    color: var(--text-primary-dark);
    background-color: var(--tag-bg-dark);
}

body.dark-mode .control-btn.active {
    color: var(--accent-dark);
    background-color: rgba(108, 99, 255, 0.1);
}

body.dark-mode .device-preview-close {
    color: var(--text-secondary-dark);
}

body.dark-mode .device-preview-close:hover {
    color: var(--text-primary-dark);
    background-color: var(--tag-bg-dark);
}

body.dark-mode .device-viewport {
    background-color: #121212;
    border-color: var(--border-dark);
}

body.dark-mode .device-viewport[data-device="desktop"],
body.dark-mode .device-viewport[data-device="tablet"],
body.dark-mode .device-viewport[data-device="mobile"] {
    box-shadow: var(--shadow-dark);
    border-color: var(--border-dark);
}

body.dark-mode .device-viewport[data-device="mobile"]::before {
    background-color: var(--border-dark);
}

body.dark-mode .device-loader {
    background-color: rgba(18, 18, 18, 0.9);
}

body.dark-mode .spinner {
    border-top-color: #3a36e0;
}

body.dark-mode .device-error {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Transition for smooth theme switching */
.project-showcase,
.project-content-section,
.content-block,
.project-sidebar .sidebar-widget,
.tech-tag,
.project-navigation .nav-btn,
.lightbox-content,
.device-preview-container,
.device-viewport {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
} 

/* Gallery improvements for dark mode */
body.dark-mode .gallery-grid {
    background-color: transparent;
}

body.dark-mode .gallery-item {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
}

body.dark-mode .gallery-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
}

body.dark-mode .gallery-item::after {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Fix for the mobile device preview in dark mode */
@media (max-width: 576px) {
    body.dark-mode .device-viewport[data-device="mobile"] {
        border-color: #333;
    }
    
    body.dark-mode .device-viewport[data-device="mobile"]::before {
        background-color: #333;
    }
} 

/* Light Mode Improvements */
.project-content-section {
    background-color: var(--bg-light);
}

.content-block {
    background-color: var(--bg-card-light);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.content-block h2 {
    color: var(--text-primary-light);
}

.rich-text {
    color: var(--text-secondary-light);
}

.project-sidebar .sidebar-widget {
    background-color: var(--bg-card-light);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.sidebar-widget h3 {
    color: var(--text-primary-light);
}

.info-label {
    color: var(--text-secondary-light);
}

.info-value {
    color: var(--text-primary-light);
}

.tech-tag {
    background-color: var(--tag-bg-light);
    color: var(--tag-text-light);
}

.tech-tag:hover {
    background-color: var(--accent-light);
    color: white;
}

.project-navigation .nav-btn {
    background-color: var(--bg-card-light);
    color: var(--text-primary-light);
    border: 1px solid var(--border-light);
}

.project-navigation .nav-btn:hover {
    background-color: var(--tag-bg-light);
}

/* Gallery improvements for light mode */
.gallery-item {
    background-color: var(--bg-card-light);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
} 

/* Updated Dark Mode Styles using CSS Variables */
body.dark-mode .project-content-section {
    background-color: var(--bg-dark);
}

body.dark-mode .content-block {
    background-color: var(--bg-card-dark);
    box-shadow: var(--shadow-dark);
    border: 1px solid var(--border-dark);
}

body.dark-mode .content-block h2 {
    color: var(--text-primary-dark);
}

body.dark-mode .rich-text {
    color: var(--text-secondary-dark);
}

body.dark-mode .project-sidebar .sidebar-widget {
    background-color: var(--bg-card-dark);
    box-shadow: var(--shadow-dark);
    border: 1px solid var(--border-dark);
}

body.dark-mode .sidebar-widget h3 {
    color: var(--text-primary-dark);
}

body.dark-mode .info-label {
    color: var(--text-secondary-dark);
}

body.dark-mode .info-value {
    color: var(--text-primary-dark);
}

body.dark-mode .tech-tag {
    background-color: var(--tag-bg-dark);
    color: var(--tag-text-dark);
}

body.dark-mode .tech-tag:hover {
    background-color: var(--accent-dark);
    color: white;
}

body.dark-mode .project-navigation .nav-btn {
    background-color: var(--bg-card-dark);
    color: var(--text-primary-dark);
    border: 1px solid var(--border-dark);
}

body.dark-mode .project-navigation .nav-btn:hover {
    background-color: var(--tag-bg-dark);
}

body.dark-mode .gallery-item {
    background-color: var(--bg-card-dark);
    box-shadow: var(--shadow-dark);
    border: 1px solid var(--border-dark);
} 

/* Device Preview in Light Mode using CSS Variables */
.device-preview-modal .device-preview-overlay {
    background-color: rgba(0, 0, 0, 0.75);
}

.device-preview-container {
    background-color: var(--bg-card-light);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
}

.device-preview-header {
    border-bottom: 1px solid var(--border-light);
}

.device-preview-header h3 {
    color: var(--text-primary-light);
}

.control-btn {
    color: var(--text-secondary-light);
    background-color: transparent;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: var(--text-primary-light);
    background-color: var(--tag-bg-light);
}

.control-btn.active {
    color: var(--accent-light);
    background-color: rgba(58, 54, 224, 0.1);
}

.device-preview-close {
    color: var(--text-secondary-light);
    transition: all 0.3s ease;
}

.device-preview-close:hover {
    color: var(--text-primary-light);
    background-color: var(--tag-bg-light);
}

.device-viewport {
    background-color: white;
    border-color: #e0e0e0;
    transition: all 0.3s ease;
}

.device-viewport[data-device="desktop"] {
    box-shadow: var(--shadow-light);
}

.device-viewport[data-device="tablet"] {
    border-color: #e0e0e0;
    box-shadow: var(--shadow-light);
}

.device-viewport[data-device="mobile"] {
    border-color: #e0e0e0;
    box-shadow: var(--shadow-light);
}

.device-viewport[data-device="mobile"]::before {
    background-color: #e0e0e0;
} 

/* Lightbox improvements for Light Mode */
.lightbox {
    background-color: rgba(0, 0, 0, 0.85);
    transition: all 0.3s ease;
}

.lightbox-content {
    background-color: var(--bg-card-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.lightbox-close {
    color: var(--text-primary-light);
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--accent-light);
}

/* Lightbox improvements for Dark Mode */
body.dark-mode .lightbox {
    background-color: rgba(0, 0, 0, 0.95);
}

body.dark-mode .lightbox-content {
    background-color: var(--bg-card-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
}

body.dark-mode .lightbox-close {
    color: var(--text-primary-dark);
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--accent-dark);
}

/* Add a theme toggle button to the project page */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--accent-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

body.dark-mode .theme-toggle {
    background-color: var(--accent-dark);
}

[dir="rtl"] .theme-toggle {
    right: auto;
    left: 20px;
} 

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
} 

/* Enhanced project title with animation */
.project-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff; /* لون العنوان في الوضع الفاتح على خلفية الـ showcase */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* إضافة ظل للنص لتحسين القراءة */
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Animated highlight effect for the title */
.project-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Title hover effect in light mode */
.project-title:hover::after {
    width: 100%;
}

[dir="rtl"] .project-title::after {
    left: auto;
    right: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.9));
}

/* Make the title more visible on the gradient background */
.project-intro {
    position: relative;
    z-index: 2;
}

/* Add a subtle text glow in light mode */
@media (min-width: 768px) {
    .project-title {
        letter-spacing: -0.5px;
    }
    
    .project-title:hover {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.2);
    }
} 

/* Responsive improvements for project title */
@media (max-width: 768px) {
    .project-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .project-title::after {
        height: 3px;
        bottom: -3px;
    }
}

@media (max-width: 576px) {
    .project-title {
        font-size: 1.75rem;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    .project-title::after {
        width: 40px;
    }
    
    body.dark-mode .project-title {
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    }
}

@media (max-width: 400px) {
    .project-title {
        font-size: 1.5rem;
    }
} 