/* Custom styles for AAA Secondhand website */

/* Brand colors */
:root {
    --brand-blue: #071440;
    --brand-green: #07f851;
    --brand-white: #ffffff;
}

/* Remove color overlay from banner slideshow */
#banner:after {
    background-color: transparent !important;
    opacity: 0 !important;
}

/* Banner logo styling */
.banner-logo {
    max-width: 700px;
    height: auto;
}

@media screen and (max-width: 980px) {
    .banner-logo {
        max-width: 550px;
    }
}

@media screen and (max-width: 736px) {
    .banner-logo {
        max-width: 400px;
    }
}

/* Announcement banner - styled like header */
#announcement-banner {
    background-color: var(--brand-blue) !important;
    background: var(--brand-blue) !important;
    background-image: none !important;
    color: var(--brand-green);
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 1em;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-content {
    max-width: 1200px;
    margin: 0 auto;
}

@media screen and (max-width: 980px) {
    #announcement-banner {
        min-height: 70px;
        padding: 12px 15px;
    }
}

@media screen and (max-width: 736px) {
    #announcement-banner {
        min-height: 60px;
        font-size: 0.9em;
        padding: 10px;
    }
}

/* Remove header animation and fix header to top */
#header {
    -moz-animation: none !important;
    -webkit-animation: none !important;
    -ms-animation: none !important;
    animation: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10000 !important;
}

#header.alt {
    -moz-transition: none !important;
    -webkit-transition: none !important;
    -ms-transition: none !important;
    transition: none !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
}

/* Remove top padding when no header/banner */
body.no-header #banner {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.no-header #wrapper {
    padding-top: 0 !important;
}

/* Tiles text readability improvements */
.tiles article header.major h3 {
    color: var(--brand-white) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    font-size: 1.3em;
}

.tiles article header.major p {
    color: var(--brand-white) !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    font-weight: 400;
    font-size: 0.95em;
}

/* Ensure tile text is always readable */
.tiles article .major {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

/* Map divider styles */
#map-divider {
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.map-header {
    background: linear-gradient(135deg, var(--brand-blue), #0a1a4a);
    padding: 40px 40px;
    text-align: center;
    position: relative;
    z-index: 100;
}

.map-header h2 {
    color: var(--brand-white);
    font-size: 2.5em;
    margin-bottom: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--brand-white);
    display: inline-block;
}

.map-header p {
    color: var(--brand-white);
    font-size: 1.1em;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0.95;
}

#map-divider iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

/* Slideshow styles */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    top: 0;
    z-index: 1;
}

#banner {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    top: 0;
    z-index: 1;
}

#banner .inner {
    margin-top: 0;
    padding-top: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* Ensure banner content doesn't overflow */
#banner .inner {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Navigation slideshow controls */
.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 18px;
    z-index: 20;
}

.slideshow-nav.prev {
    left: 20px;
}

.slideshow-nav.next {
    right: 20px;
}

.slideshow-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Header customization */
#header {
    background-color: var(--brand-blue) !important;
    background: var(--brand-blue) !important;
    background-image: none !important;
    padding: 15px 0;
    min-height: 80px;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0 !important;
    top: 0 !important;
}

#header.alt {
    background-color: var(--brand-blue) !important;
    background: var(--brand-blue) !important;
    background-image: none !important;
}

#header .logo {
    color: var(--brand-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    flex: 1;
}

/* Gallery page header - logo on left */
.gallery-page #header .logo {
    justify-content: flex-start !important;
    padding-left: 20px;
}

#header .logo img {
    height: 50px;
    margin-right: 12px;
    border-radius: 5px;
}

#header .logo span {
    color: var(--brand-green);
    font-size: 1em;
}

/* Header without menu */
#header {
    justify-content: center;
}

/* Tiles customization */
.tiles article .image img {
    transition: transform 0.3s ease;
}

.tiles article:hover .image img {
    transform: scale(1.05);
}

/* Alternating tile sizes - zigzag pattern */
.tiles {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    z-index: 100;
}

.tiles article {
    width: 50%;
    min-height: 40vh;
    position: relative;
    z-index: 100;
}

/* Section one (gallery) - zigzag pattern */
#one.tiles article:nth-child(4n+1) {
    width: 40%;
}

#one.tiles article:nth-child(4n+2) {
    width: 60%;
}

#one.tiles article:nth-child(4n+3) {
    width: 60%;
}

#one.tiles article:nth-child(4n+4) {
    width: 40%;
}

/* Section two - opposite start from section one's end */
/* Section one has 6 tiles ending with 40%-60%, so section two starts with 60%-40% */
#two.tiles article:nth-child(4n+1) {
    width: 60%;
}

#two.tiles article:nth-child(4n+2) {
    width: 40%;
}

#two.tiles article:nth-child(4n+3) {
    width: 40%;
}

#two.tiles article:nth-child(4n+4) {
    width: 60%;
}

/* Make last article full width when it's alone on the bottom row */
#two.tiles article:last-child:nth-child(odd) {
    width: 100%;
}

/* Contact section customization */
.contact-method .icon {
    color: var(--brand-green);
}

.contact-split {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 0;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-split > section {
    flex: 1 1 200px;
    padding: 0 60px;
    min-width: 200px;
}

/* Adjust padding for medium screens */
@media (max-width: 1280px) and (min-width: 740px) {
    .contact-split > section {
        padding: 0 40px;
    }
}

/* Only show line when sections are side by side (width >= 740px) */
@media (min-width: 740px) {
    .contact-split > section:first-child {
        border-right: 2px solid rgba(255, 255, 255, 0.2);
    }
}

/* When sections stack (below 740px), remove line and add spacing */
@media (max-width: 739px) {
    .contact-split > section {
        flex: 1 1 100%;
        padding: 0 40px;
    }
    
    .contact-split > section:first-child {
        border-right: none;
        padding-bottom: 30px;
        margin-bottom: 30px;
    }
}

/* Footer customization */
#footer {
    background-color: var(--brand-blue);
    padding: 2em 0 !important;
}

#footer .inner {
    padding: 0 !important;
}

#footer .copyright {
    color: var(--brand-white);
    margin: 0 !important;
}

/* Lightbox styles */
#lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    margin: auto;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 40px;
    color: var(--brand-white);
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
    user-select: none;
}

.lightbox-close:hover {
    color: var(--brand-green);
}

.lightbox-nav {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--brand-white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    background: rgba(7, 20, 64, 0.7);
    border: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10001;
    user-select: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    line-height: 1;
}

/* Remove extra arrows from template */
.lightbox-nav:before,
.lightbox-nav:after {
    content: none !important;
    display: none !important;
}

/* Remove extra padding from .next button */
button.lightbox-nav.next {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.lightbox-nav:hover {
    background: var(--brand-blue);
    color: var(--brand-green);
}

.lightbox-nav.prev {
    left: 20px !important;
    right: auto !important;
}

.lightbox-nav.next {
    right: 20px !important;
    left: auto !important;
}

#lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--brand-white);
    font-size: 18px;
    background: rgba(7, 20, 64, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 10001;
    user-select: none;
}

/* Gallery item hover effect */
.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

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

.gallery-item img {
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .lightbox-nav {
        font-size: 30px;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-nav.prev {
        left: 10px !important;
        right: auto !important;
    }
    
    .lightbox-nav.next {
        right: 10px !important;
        left: auto !important;
    }
    
    #lightbox-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 15px;
    }
    
    #lightbox-img {
        max-width: 95%;
        max-height: 80vh;
    }
}

/* Text Modal Styles */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-backdrop.active {
    display: block;
}

.text-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10000;
    border-radius: 15px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.text-modal::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.text-modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-content-text {
    background: rgba(7, 20, 64, 0.25);
    border-radius: 15px;
    padding: 0;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content-text h2 {
    background: transparent;
    color: var(--brand-white);
    font-size: 2.5em;
    margin: 0;
    padding: 40px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 3px solid var(--brand-green);
    border-radius: 15px 15px 0 0;
}

.modal-text {
    color: var(--brand-white);
    font-size: 1.1em;
    line-height: 1.8;
    text-align: left;
    margin: 0;
    padding: 40px 60px;
    font-weight: 400;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--brand-white);
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 0;
    padding: 0;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 10001;
    user-select: none;
}

.modal-close:hover {
    color: var(--brand-green);
    transform: rotate(90deg);
}

.modal-images {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 40px 60px 60px;
    gap: 40px;
    flex-wrap: wrap;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 15px 15px;
}

.modal-image-container {
    flex: 1;
    min-width: 280px;
    max-width: 45%;
}

.modal-image-container img {
    width: 100%;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-image-container img:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    border-color: var(--brand-green);
}

.modal-image-container p {
    margin-top: 15px;
    color: var(--brand-white);
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.05em;
}

/* Responsive modal */
@media (max-width: 1024px) {
    .text-modal {
        width: 90%;
    }
    
    .modal-text {
        padding: 30px 40px;
    }
    
    .modal-images {
        padding: 30px 40px 50px;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .text-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-content-text h2 {
        font-size: 1.8em;
        padding: 30px 20px;
        letter-spacing: 0.05em;
    }
    
    .modal-text {
        font-size: 1em;
        padding: 30px 25px;
    }
    
    .modal-images {
        padding: 30px 25px 40px;
        gap: 25px;
    }
    
    .modal-image-container {
        max-width: 100%;
        min-width: 100%;
    }
    
    .modal-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Reset tile sizes for mobile - all 50% */
    .tiles article {
        width: 50% !important;
    }
    
    /* Make last article full width when alone on bottom row (tablet view) */
    #two.tiles article:last-child:nth-child(odd) {
        width: 100% !important;
    }
    
    .tiles article header.major h3 {
        font-size: 1.1em;
    }
    
    .tiles article header.major p {
        font-size: 0.85em;
    }
    
    .map-header {
        padding: 30px 30px;
    }
    
    .map-header h2 {
        font-size: 2em;
    }
    
    .map-header p {
        font-size: 1em;
    }
    
    #header {
        padding: 12px 0;
        min-height: 70px;
    }
    
    #header .logo img {
        height: 45px;
        margin-right: 10px;
    }
    
    #header .logo {
        font-size: 1em;
    }
    
    #header .logo span {
        font-size: 0.9em;
        margin-left: 8px;
    }
    
    .slideshow-nav {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .slideshow-container {
        height: 100vh;
        max-height: 100vh;
    }
    
    #banner {
        height: 100vh;
        max-height: 100vh;
    }
}

@media (max-width: 1300px) {
    /* Make slideshow serve as background on mobile/tablet */
    #banner .slideshow-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }
    
    #banner .inner {
        position: relative;
        z-index: 2;
        background: rgba(0, 0, 0, 0.4);
        padding: 40px 20px;
        border-radius: 10px;
        backdrop-filter: blur(5px);
    }
    
    #banner .inner h1 {
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    }
    
    #banner .inner p {
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
        display: block;
        margin-bottom: 20px;
    }
    
    #banner .inner .content .actions {
        display: block;
        margin-top: 20px;
    }
    
    #banner .inner .content .actions li {
        display: block;
        margin: 0;
    }
    
    #banner .inner .content .actions .button {
        display: block;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Full width tiles on small mobile */
    .tiles article {
        width: 100% !important;
    }
    
    .tiles article header.major h3 {
        font-size: 1em;
    }
    
    .tiles article header.major p {
        font-size: 0.8em;
    }
    
    .map-header {
        padding: 25px 20px;
    }
    
    .map-header h2 {
        font-size: 1.5em;
    }
    
    .map-header p {
        font-size: 0.95em;
    }
    
    #header {
        padding: 10px 0;
        min-height: 60px;
    }
    
    #header .logo img {
        height: 40px;
        margin-right: 8px;
    }
    
    #header .logo {
        font-size: 0.9em;
    }
    
    #header .logo span {
        font-size: 0.8em;
        margin-left: 6px;
    }
}