/**
 * Footer Styles
 * 
 * @package YuuYuuRental
 * @since 1.0.0
 */

/* ==========================================================================
   White Footer
   ========================================================================== */
.site-footer-white {
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
    margin-top: auto;
    position: relative;
    z-index: 10;
    width: 100%;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.footer-main {
    padding: 60px 20px 40px;
}

.footer-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
}

/* Modern browsers with grid support */
@supports (display: grid) and (not (-webkit-appearance: none)) {
    .footer-content {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 40px;
        align-items: flex-start;
    }
}

/* Safari fallback to flexbox */
@supports (-webkit-appearance: none) {
    .footer-content {
        display: -webkit-flex;
        display: flex;
        -webkit-justify-content: space-between;
        justify-content: space-between;
        -webkit-align-items: flex-start;
        align-items: flex-start;
    }
    
    .footer-column {
        -webkit-flex: 1;
        flex: 1;
    }
    
    .footer-column.footer-company {
        -webkit-flex: 2;
        flex: 2;
        max-width: 40%;
    }
}

/* ==========================================================================
   Footer Columns
   ========================================================================== */
.footer-column {
    display: flex;
    flex-direction: column;
}

/* Company Info Section */
.footer-company {
    max-width: 100%;
}

.footer-logo {
    margin-bottom: 20px;
    text-align: left;
}

.footer-logo img {
    max-height: 60px;
    width: auto;
}

.footer-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-secondary);
    text-decoration: none;
}

.footer-description {
    text-align: left;
}

.footer-description p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: left;
    word-wrap: break-word;
    word-break: keep-all;
}

.footer-license {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    font-size: 0.875rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-license i {
    color: var(--color-primary);
}

/* Footer Titles */
.footer-title {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.footer-title-en {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-title-jp {
    font-size: 1.125rem;
    font-weight: bold;
    color: #333;
}

/* Footer Navigation */
.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav li {
    margin-bottom: 0;
}

.footer-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    padding: 4px 0;
    display: block;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

/* Contact Information */
.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-item i {
    color: var(--color-primary);
    font-size: 1rem;
    width: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.contact-value {
    color: #333;
    font-size: 0.875rem;
}

.contact-value a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-value a:hover {
    color: var(--color-primary);
}

/* Language Switcher */
.footer-language-switcher {
    margin-bottom: 25px;
}

.language-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    text-decoration: none;
}

.lang-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.lang-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.lang-btn img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

/* Social Media */
.footer-social {
    margin-top: 20px;
}

.social-title {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    color: #666;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
}

.social-links a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================================================
   Footer Bottom
   ========================================================================== */
.footer-bottom {
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
    padding: 20px 40px;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.copyright p {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.875rem;
}

.footer-bottom-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom-links a:hover {
    color: var(--color-primary);
}

.separator {
    color: #ccc;
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 1000;
    display: none;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .footer-main {
        padding: 60px 30px 40px;
    }
    
    .footer-bottom {
        padding: 20px 40px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .footer-company {
        grid-column: 1 / -1;
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .footer-main {
        padding: 40px 20px 30px;
    }
    
    .footer-bottom {
        padding: 20px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px 20px;
        align-items: start;
    }
    
    .footer-company {
        grid-column: 1 / -1;
        margin-bottom: 20px;
        text-align: left;
    }
    
    /* Menu section */
    .footer-column:nth-child(2) {
        text-align: left;
    }
    
    .footer-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: left;
    }
    
    .footer-nav a {
        padding: 6px 0;
        font-size: 0.9rem;
        text-align: left;
    }
    
    /* Contact section */  
    .footer-column:nth-child(3) {
        text-align: left;
    }
    
    .footer-contact-info {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    /* Language section - single column, spanning full width */
    .footer-column:nth-child(4) {
        grid-column: 1 / -1;
        text-align: left;
        margin-top: 10px;
    }
    
    .footer-title {
        text-align: left;
        margin-bottom: 15px;
    }
    
    .footer-title-en {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    
    .footer-title-jp {
        font-size: 1rem;
    }
    
    /* Contact items - more compact */
    .contact-item {
        margin-bottom: 15px;
        justify-content: flex-start;
    }
    
    .contact-details {
        text-align: left;
    }
    
    .contact-label {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }
    
    .contact-value {
        font-size: 0.9rem;
    }
    
    /* Language switcher - horizontal layout */
    .footer-language-switcher {
        display: flex;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .lang-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Extra small screens - further optimization */
@media (max-width: 480px) {
    .footer-content {
        display: block !important;
        width: 100% !important;
        font-size: 0 !important; /* Remove whitespace between inline-block elements */
    }
    
    .footer-content > * {
        margin-bottom: 25px !important;
        font-size: 14px !important; /* Reset font size */
    }
    
    .footer-content > *:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Company info - first row, full width */
    .footer-company {
        width: 100% !important;
        max-width: 100% !important;
        text-align: left !important;
        padding: 0 !important;
        display: block !important;
        float: none !important;
        margin: 0 0 25px 0 !important;
        box-sizing: border-box !important;
    }
    
    .footer-company * {
        text-align: left !important;
        box-sizing: border-box !important;
    }
    
    .footer-company .footer-description {
        width: 100% !important;
        text-align: left !important;
    }
    
    .footer-company .footer-description p {
        text-align: left !important;
        width: 100% !important;
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
    }
    
    /* Menu and Contact - second row, side by side */
    .footer-menu {
        display: block !important;
        width: 49% !important;
        text-align: center !important;
        float: left !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
    }
    
    .footer-contact {
        display: block !important;
        width: 49% !important;
        text-align: center !important;
        float: right !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
    }
    
    /* Clear floats after menu and contact */
    .footer-menu:after,
    .footer-contact:after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Language selector - third row, full width */
    .footer-language {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin: 40px 0 0 0 !important;
        clear: both !important;
        padding: 40px 0 !important;
    }
    
    .footer-nav,
    .footer-contact-info {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .footer-title {
        margin-bottom: 12px;
    }
    
    .footer-nav-links {
        gap: 6px;
    }
    
    .contact-item {
        margin-bottom: 12px;
        text-align: center;
        gap: 8px;
    }
    
    .contact-label {
        font-size: 0.75rem;
    }
    
    .contact-value {
        font-size: 0.85rem;
    }
    
    .lang-btn {
        min-width: 70px;
        padding: 6px 10px;
    }
    
    .lang-btn span {
        font-size: 0.75rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-bottom-links {
        align-items: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
    }
    
    /* Additional styling for very small screens */
    .footer-main {
        padding: 30px 20px 20px;
    }
    
    .footer-bottom {
        padding: 20px 20px;
    }
    
    .footer-description p {
        font-size: 0.875rem;
        line-height: 1.6;
        text-align: center;
    }
    
    .footer-license {
        font-size: 0.75rem;
        padding: 10px 12px;
    }
    
    .footer-nav a {
        font-size: 0.875rem;
    }
    
    .contact-value {
        font-size: 0.8rem;
    }
    
    .language-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .lang-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 8px 12px;
        min-width: auto;
    }
    
    .social-links a {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}