/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
.text-link{
    color: #4CAF50;
}
.project-github-btn {
  margin: 2rem 0;
  /* aby tlačítko táhlo napříč parent konteinerem */
  width: 100%;
  text-align: center;
}

.project-github-btn a {
  display: inline-block;
  width: 100%;           /* full-width vůči rodiči */
  max-width: 400px;      /* ale omezíme šířku pro lepší čitelnost */
  padding: 1rem 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background-color: #24292e; /* tmavé GitHub-černo */
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.project-github-btn a:hover {
  background-color: #444950;
}






/* Video Player */
.video-container {
    margin: 30px 0;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}






.video-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.video-container video {
    width: 100%;
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    background-color: #000;
}

.video-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.video-control-button {
    display: flex;
    align-items: center;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.video-control-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.video-control-button svg {
    margin-right: 8px;
}

.video-control-button:active {
    transform: translateY(0);
}


body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
}


/* Demo button */
.demo-button-container {
    margin: 30px 0;
    text-align: center;
}

.demo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #4CAF50;
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.demo-button:hover {
    background-color: #4CAF50;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.demo-button-icon {
    margin-right: 10px;
    font-size: 20px;
}

.demo-button-text {
    letter-spacing: 0.5px;
}


section {
    margin: 4rem 0;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.code-container {
    background-color: #f5f5f5;
    border-radius: 6px;
    margin: 20px 0;
    overflow-x: auto;
}

.code-container pre {
    margin: 0;
    padding: 15px;
}

.code-container code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Collapsible Code Container */
.code-container {
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.code-container.collapsed .code-content {
  display: none;
}



.code-toggle-button {
  background-color: #4CAF50;
  color: white;
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  transition: background-color 0.3s;
}

.code-toggle-button:hover {
  background-color: #45a049;
}

.code-toggle-icon {
  font-size: 20px;
  transition: transform 0.3s;
}

.code-container:not(.collapsed) .code-toggle-icon {
  transform: rotate(45deg);
}

.code-container:not(.collapsed) .code-button-text {
  content: "Skrýt kód";
}

.code-content {
  background-color: #f8f8f8;
  max-height: 500px;
  overflow-y: auto;
}

.code-content pre {
  margin: 0;
  padding: 15px;
}

.code-content code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}
.responsive-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    margin: 20px 0;
}

.responsive-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
/* Enhanced Back Button with Smooth Collapse */
.back-button {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem; /* Adjusted padding to match projekt2 */
    gap: 12px; /* Increased gap between arrow and text */
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    overflow: hidden;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* You can remove or comment these out if using dynamic inline styles */
/*
.back-button.collapsed {
    width: 40px;
    padding: 0;
    background-color: rgba(76, 175, 80, 0.9);
}
.back-button.collapsed span {
    opacity: 0;
}
.back-button.collapsed .arrow {
    transform: translateX(-50%);
    left: 50%;
}
*/

.back-button .arrow {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-button .arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: translate(-50%, -50%) rotate(45deg);
    margin-left: -2px;
}

.back-button span {
    opacity: 1;
    max-width: 200px;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    padding-right: 8px; /* Adjusted padding after text */
}

.back-button.collapsed span {
    opacity: 0;
    max-width: 0;
    padding: 0;
}

.back-button.collapsed .arrow {
    transform: translateX(-50%);
    left: 50%;
}

.back-button:hover {
    background-color: #45a049;
    transform: translateX(-50%) scale(1.05);
}

.back-button:hover.collapsed {
    /* When hovering a collapsed button, expand it fluidly */
    width: auto;
    padding: 0.8rem 1.8rem;
}

.back-button:hover.collapsed span {
    opacity: 1;
    max-width: 200px;
    padding-right: 8px;
}

.back-button:hover.collapsed .arrow {
    transform: none;
    left: 0;
    position: relative;
}

/* Rest of the CSS remains unchanged */
.project-header {
    text-align: center;
    margin-bottom: 2rem;
}

.project-image-main {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 2rem 0;
}

/* ... (keep all other existing styles below exactly as they were) ... */

.project-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.project-details td {
    padding: 1rem;
    border: 1px solid #ddd;
}

.project-details td:first-child {
    font-weight: bold;
    width: 30%;
    background-color: #f9f9f9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    vertical-align: middle;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.text-images {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

.image-pair {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    width: 100%;
    flex-direction: column;
}

/* Responsive image styles */
.inline-image {
    flex: 1;
    min-width: 250px;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 5px;
    transition: transform 0.3s;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    cursor: pointer; /* Add pointer cursor to show it's clickable */
}

/* Size variations - mobile first */
.inline-image[style*="width: 40%"], 
.inline-image[style*="width: 50%"], 
.inline-image[style*="width: 60%"],
.inline-image[style*="width: 80%"] {
    width: 100%;
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.9em;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh; /* Increased from 80vh */
    border-radius: 8px;
    object-fit: contain; /* Ensures the image maintains its aspect ratio */
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
}

.close-btn {
    position: absolute;
    top: -30px;
    right: -30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ff0000;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transition: all 0.3s;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

.lightbox-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
}

.lightbox-arrow.prev {
    left: 20px;
}

.lightbox-arrow.next {
    right: 20px;
}

.lightbox-arrow svg {
    width: 28px;
    height: 28px;
}



.download-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.download-list li {
    margin: 12px 0;
}

.download-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: #4CAF50;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.download-link:hover {
    background-color: #e9e9e9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.download-icon {
    font-size: 1.5em;
    margin-right: 15px;
    font-style: normal;
}

.download-text {
    font-size: 1.1em;
}

.scroll-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #4CAF50;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    opacity: 0;
    transition: 
        opacity 0.3s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    border: none;
    cursor: pointer;
    transform: translateY(20px);
}

.scroll-top-button.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top-button:hover {
    background: #45a049;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.35);
}

.scroll-top-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.scroll-top-button:hover svg {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 250px;
    }

    .close-btn {
        top: -15px;
        right: 0;
        font-size: 1.5rem;
    }

    .image-pair {
        flex-direction: column;
    }
    
    .inline-image {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .scroll-top-button {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .lightbox-arrow {
        font-size: 2rem;
        padding: 0.5rem;
        width: 50px;
        height: 50px;
    }

    .lightbox-arrow.prev {
        left: 1rem;
    }

    .lightbox-arrow.next {
        right: 1rem;
    }

    .back-button {
        top: 10px;
        height: 36px;
    }
    
    .back-button.collapsed {
        width: 36px;
    }
    
    .back-button .arrow {
        width: 16px;
        height: 16px;
    }

    .lightbox-arrow {
        width: 40px;
        height: 40px;
    }

    .lightbox-arrow svg {
        width: 22px;
        height: 22px;
    }

    .lightbox-arrow.prev {
        left: 10px;
    }

    .lightbox-arrow.next {
        right: 10px;
    }
}

/* Desktop styles */
@media (min-width: 768px) {
    .image-pair {
        flex-direction: row;
        align-items: flex-start;
    }
    
    /* Size variations for desktop */
    .inline-image[style*="width: 40%"] {
        width: 40%;
    }
    
    .inline-image[style*="width: 50%"] {
        width: 50%;
    }
    
    .inline-image[style*="width: 60%"] {
        width: 60%;
    }
    
    .inline-image[style*="width: 80%"] {
        width: 80%;
    }
    
    /* Special handling for single image not in a pair */
    .text-images > .inline-image {
        max-width: 70%;
    }
}