/* ============================================
   VARIABLES AND GLOBAL STYLES
   ============================================ */

/* Image fade-in on load */
img {
    opacity: 0;
    transition: opacity 0.6s ease;
}
img.img-loaded {
    opacity: 1;
}

:root {
    --blue: #0d6efd;
    --blue-dark: #0b5ed7;
    --white: #ffffff;
    --black: #0b0b0b;
    --muted: #6c757d;
    --bg: #f8fafc;
    --glass: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ACCESSIBILITY - SKIP LINK
   ============================================ */

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    padding: 8px 12px;
    background: var(--blue);
    color: var(--white);
    border-radius: 4px;
    z-index: 2000;
}

/* ============================================
   NAVBAR - DEFAULT STATE (AT TOP)
   ============================================ */

.custom-navbar .container,
.custom-navbar .container-fluid {
    max-width: 80%;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

.custom-navbar {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    --nav-height: 88px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background-color: transparent;
    color: var(--black);
    transition: height 260ms cubic-bezier(.2, .8, .2, 1),
                box-shadow 260ms ease,
                background-color 260ms ease,
                color 260ms ease;
    /*backdrop-filter: blur(4px);*/
    padding-top: 0;
    padding-bottom: 0;
    box-shadow: 0 2px 6px rgba(11, 13, 20, 0.06);
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

.custom-navbar .navbar-brand {
    font-weight: 600;
    color: var(--black);
    flex-shrink: 0;
    z-index: 2000;
}


.custom-navbar .brand-icon {
    font-size: 1.4rem;
}

/* Nav Links - Default (at top) */
.custom-navbar .nav-link {
    color: var(--black) !important;
    opacity: 1;
    padding: 0.5rem 0.75rem;
    transition: color 160ms ease, background-color 160ms ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link:focus {
    color: rgba(0, 0, 0, 0.8) !important;
    font-weight: 600;
    background: rgba(13, 110, 253, 0.04);
    border-radius: 6px;
}

.custom-navbar .nav-link.active {
    color: var(--black) !important;
    position: relative;
}

.custom-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 45%;
    height: 3px;
    background-color: var(--black);
    border-radius: 2px;
}

/* ============================================
   NAVBAR - COMPACT STATE (SCROLLED DOWN)
   ============================================ */

.custom-navbar.compact {
    --nav-height: 58px;
    height: var(--nav-height);
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 18px rgba(11, 13, 20, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.custom-navbar.compact .nav-link:hover,
.custom-navbar.compact .nav-link:focus {
    color: rgba(0,0,0, 0.75);
    background: rgba(255, 255, 255, 0.25);
}

/* Toggler Button */
.custom-navbar .navbar-toggler {
    border: none;
    color: var(--black);
    padding: 0.33rem 0.5rem;
    font-size: 1.5rem;
    position: relative;
    z-index: 1050;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-navbar .navbar-toggler:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.custom-navbar .navbar-toggler.collapsed,
.custom-navbar .navbar-toggler:not(.collapsed) {
    width: 44px !important;
    height: 44px !important;
    padding: 0.33rem 0.5rem !important;
}

.custom-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='currentColor' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
    width: 1em;
    height: 1em;
}

/* Mobile Menu - Default State */
.custom-navbar .navbar-collapse {
    transition: transform 300ms cubic-bezier(.2, .8, .2, 1),
                opacity 300ms cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
}

.custom-navbar .navbar-collapse:not(.show) {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.custom-navbar .navbar-collapse.show {
    background-color: var(--white);
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    padding: 100px 20px 20px 20px;
    margin: 0;
    border-radius: 0;
    box-shadow: -2px 0 18px rgba(11, 13, 20, 0.15);
    overflow-y: auto;
    z-index: 1040;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-navbar .navbar-collapse.show .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100%;
}

.custom-navbar .navbar-collapse.show .nav-link {
    font-weight: 600;
    color: var(--black) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 16px;
    margin-bottom: 12px;
    border-radius: 6px;
}

/* Overlay za drawerm */
body::before {
    display: none;
}

/* Mobile Menu - Compact State */
.custom-navbar.compact .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

/* Desktop - Show horizontal menu instead of drawer */
@media (min-width: 992px) {
    .custom-navbar .navbar-collapse {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-left: auto !important;
        margin: 0 !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    .custom-navbar .navbar-collapse.show {
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        z-index: auto !important;
    }

    .custom-navbar .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        margin: 0 !important;
        margin-left: 0 !important;
    }

    .custom-navbar .nav-item {
        display: block !important;
    }

    .custom-navbar .nav-link {
        display: inline-flex !important;
        padding: 0.5rem 0.75rem !important;
        flex-direction: row !important;
    }

    .custom-navbar .navbar-collapse.show .nav-link {
        flex-direction: row !important;
        text-align: left !important;
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 0 !important;
        color: var(--black) !important;
    }

    .custom-navbar .navbar-toggler {
        display: none !important;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    padding-top: 140px;
    padding-bottom: 80px;
    background: #FFF;
    /*background: linear-gradient(180deg, #e9f2ff 0%, #ffffff 100%);*/
    text-align: center;
}

.hero-section .display-5 {
    color: var(--black);
    font-weight: 600;
}

.hero-section .lead {
    color: var(--muted);
}

/* ============================================
   HERO DIAGONAL
   ============================================ */

.hero-section-diagonal {
    position: relative;
    height: 80vh;
    min-height: 500px;
    overflow: hidden;
}

/* Lewa strona – zdjęcie */
.hero-diagonal-image {
    position: absolute;
    inset: 0;
    width: 100%;
    overflow: hidden;
    filter: drop-shadow(8px 0px 50px rgba(0, 0, 0, 0.1));
}

.hero-diagonal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    clip-path: polygon(0 0, 65% 0, 0 95%);
}

/* Prawa strona – treść */
.hero-diagonal-content {
    position: absolute;
    right: 0;
    top: 0;
    width: 68%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 3rem;
    padding-right: 2rem;
}

.hero-diagonal-inner {
    text-align: left;
}

.hero-logo {
    max-height: 250px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .hero-section-diagonal {
        flex-direction: column;
        height: auto;
        min-height: unset;
    }

    .hero-diagonal-image {
        position: relative;
        width: 100%;
        height: 250px;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    }

    .hero-diagonal-content {
        position: relative;
        width: 100%;
        height: auto;
        padding: 2rem 1.5rem;
        justify-content: center;
        margin-top: -30%;
    }

    .hero-diagonal-inner {
        text-align: center;
    }
}

/* ============================================
   SECTIONS AND BACKGROUNDS
   ============================================ */

.section {
    padding: 60px 0;
}

.bg-light {
    background: #f7f9fb;
}

.bg-white {
    background: var(--white);
}

/* ============================================
   CARDS AND SHADOWS
   ============================================ */

.card {
    border: none;
    border-radius: 12px;
}

.shadow-sm {
    box-shadow: 0 6px 18px rgba(11, 13, 20, 0.06);
}

.shadow-lg {
    box-shadow: 0 12px 36px rgba(11, 13, 20, 0.08);
}

.service-card {
    border-radius: 12px;
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(13, 110, 253, 0.15) !important;
}

.service-card .fa-3x {
    color: var(--blue);
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
    background: linear-gradient(180deg, #ffffff 0%, #f1f8ff 100%);
}

/* ============================================
   CONTACT CARD STYLING
   ============================================ */

.contact-card {
    border: none;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.contact-card .card-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--black);
}

.contact-info {
    padding: 0;
}

.contact-info h5 {
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-info p {
    font-size: 1rem;
    color: var(--black);
    line-height: 1.8;
}

.contact-info a {
    color: var(--blue);
    transition: color 300ms ease;
    font-weight: 500;
}

.contact-info a:hover {
    color: var(--blue-dark);
}

@media (max-width: 768px) {
    .contact-card .card-body {
        padding: 2rem 1.5rem !important;
    }

    .contact-card .card-title {
        font-size: 1.5rem;
    }

    .contact-info h5 {
        font-size: 1rem;
    }

    .contact-info p {
        font-size: 0.95rem;
    }
}

/* ============================================
   FORM CONTROLS
   ============================================ */

.form-control {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(11, 13, 20, 0.08);
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.12);
    border-color: var(--blue);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background: var(--blue);
    border: none;
    transition: background-color 160ms ease;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

/* Icon Button with Tooltip */
.btn-icon-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--blue);
    text-decoration: none;
    transition: all 300ms ease;
    position: relative;
}

.btn-icon-primary:hover,
.btn-icon-primary:focus {
    background-color: var(--blue);
    color: var(--white);
    transform: scale(1.1);
}

.btn-icon-primary::after {
    content: attr(title);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--black);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
    pointer-events: none;
}

.btn-icon-primary:hover::after,
.btn-icon-primary:focus::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   GALLERY
   ============================================ */

.gallery-grid img {
    border-radius: 10px;
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.gallery-grid img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(11, 13, 20, 0.15);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: #0b1220;
    color: var(--white);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.offer-card {
    border-radius: 12px;
    border: none;
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.offer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(13, 110, 253, 0.15) !important;
}

.feature-card {
    padding: 30px 20px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 6px 18px rgba(11, 13, 20, 0.06);
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 36px rgba(13, 110, 253, 0.15);
}

.value-card {
    padding: 30px 20px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 6px 18px rgba(11, 13, 20, 0.06);
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 36px rgba(13, 110, 253, 0.15);
}

.team-card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(11, 13, 20, 0.12) !important;
}

.team-card img {
    height: 300px;
    object-fit: cover;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .hero-section {
        padding-top: 120px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding-top: 110px;
        padding-bottom: 40px;
    }

    .custom-navbar {
        --nav-height: 72px;
    }

    .custom-navbar.compact {
        --nav-height: 52px;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .custom-navbar,
    .custom-navbar * {
        transition: none !important;
    }
}

/* ============================================
   MASONRY GRID LAYOUT
   ============================================ */

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    grid-auto-flow: dense;
}

.masonry-item {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.masonry-item:nth-child(1) {
    animation: fadeInUp 0.6s ease 0.1s both;
}

.masonry-item:nth-child(2) {
    animation: fadeInUp 0.6s ease 0.2s both;
}

.masonry-item:nth-child(3) {
    animation: fadeInUp 0.6s ease 0.3s both;
}

.masonry-item:nth-child(4) {
    animation: fadeInUp 0.6s ease 0.4s both;
}

.masonry-item:nth-child(5) {
    animation: fadeInUp 0.6s ease 0.5s both;
}

.masonry-item:nth-child(6) {
    animation: fadeInUp 0.6s ease 0.6s both;
}

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

.masonry-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(11, 13, 20, 0.15) !important;
}

.masonry-item img {
    transition: transform 300ms ease;
}

.masonry-item:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TILES GRID LAYOUT - FULLWIDTH (Windows 8 Style)
   ============================================ */

.section-tiles {
    margin: 0 !important;
    padding: 0 !important;
}

.tiles-rows-wrapper {
    display: flex;
    flex-direction: column;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background-color: var(--white);
}

.tiles-grid-fullwidth {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    grid-auto-rows: 350px;
    background-color: var(--white);
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.tile {
    display: flex;
    align-items: center;
    justify-content: center;
    /*border-bottom: 1px solid rgba(0,0,255, 1);*/
    background-color: var(--white);
    transition: all 280ms ease;
    position: relative;
    overflow: hidden;
    /*box-shadow: 0 6px 18px rgba(11, 13, 20, 0.06);*/
    /*box-shadow: 50px 0 50px rgba(11, 13, 20, 0.08);*/
}

.tile.shadow-left {
    box-shadow: -60px 0 50px rgba(11, 13, 20, 0.08);
}

.tile.shadow-right {
    box-shadow: 60px 0 50px rgba(11, 13, 20, 0.08);
}

.tile-content {
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    text-align: center;
}

.tile-image {
    padding: 0;
}

.tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms ease;
    display: block;
    z-index: 10;
}

.tile:hover {
    background-color: #fafafa;
    z-index: 5;
}

.tile-image:hover img {
    transform: scale(1.08);
}

.tile-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 12px;
    margin-top: 0;
}

.tile-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tiles-grid-fullwidth {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 320px;
    }
}

@media (max-width: 768px) {
    .tiles-grid-fullwidth {
        grid-template-columns: 1fr;
        grid-auto-rows: 280px;
    }

    .tile-content {
        padding: 25px 20px;
    }

    .tile-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .tile-text {
        font-size: 0.8rem;
        margin-bottom: 10px;
        display: none;
    }

    .btn-icon-primary {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .tiles-grid-fullwidth {
        grid-auto-rows: 240px;
    }

    .tile-content {
        padding: 20px 15px;
    }

    .tile-title {
        font-size: 1rem;
    }

    .tile-title i {
        font-size: 1.8rem !important;
    }
}

/* ============================================
   TILE ACTIONS - INFO BUTTON WITH FLIP EFFECT
   ============================================ */

/* Flip container */
.tile-flip-container {
    perspective: 1000px;
}

.tile-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 500ms ease;
    transform-style: preserve-3d;
}

.tile-flip-container.flipped .tile-flip-inner {
    transform: rotateY(180deg);
}

.tile-flip-front,
.tile-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-flip-front {
    background-color: var(--white);
}

.tile-flip-back {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: var(--white);
    transform: rotateY(180deg);
}

.tile-text-back {
    font-size: 1rem;
    color: var(--white);
    line-height: 1.6;
    padding: 40px;
    text-align: center;
    margin: 0;
}

.tile-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.btn-icon-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--blue);
    border: none;
    text-decoration: none;
    transition: all 300ms ease;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.btn-icon-info:hover,
.btn-icon-info:focus {
    background-color: var(--blue);
    color: var(--white);
    transform: scale(1.1);
}

.btn-icon-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--white);
    border: none;
    text-decoration: none;
    transition: all 300ms ease;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.btn-icon-close:hover,
.btn-icon-close:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    transform: scale(1.1);
}

.mb-2-5 {
    margin-bottom: 2.5rem !important;
}

.mt-2-5 {
    margin-top: 2.5rem !important;
}


/* Mobile version - full width border */
@media (max-width: 991px) {
    .custom-navbar .nav-link.active::after {
        width: 100%;
        right: auto;
        left: 0;
    }

    .custom-navbar .container,
    .custom-navbar .container-fluid {
        max-width: 100%;
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .custom-navbar {
        width: 100%;
    }

    .tile.shadow-left {
        box-shadow: 0 -60px 50px rgba(11, 13, 20, 0.08);
    }

    .tile.shadow-right {
        box-shadow: 0 60px 50px rgba(11, 13, 20, 0.08);
    }

    .tile-text-back {
        line-height: 1.4;
        font-size: 0.9rem;
        padding: 10px;
    }
}