/* Custom CSS for Clariveil Website */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Service flow arrows */
.flow-arrow {
    position: relative;
}

.flow-arrow::after {
    content: '→';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #0ea5e9;
    font-weight: bold;
}

.flow-arrow:last-child::after {
    display: none;
}

/* Tab styles */
.tab-button {
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #0ea5e9;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #0ea5e9;
}

/* Form styles */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

/* Custom gradient backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Hero background pattern */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Header backdrop blur */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
}

/* Tab content transitions */
.tab-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.hidden {
    opacity: 0;
    transform: translateY(10px);
    display: none;
}

/* Loading animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Enhanced mobile styles */
@media (max-width: 768px) {
    .flow-arrow::after {
        content: '↓';
        right: 50%;
        top: 100%;
        transform: translateX(50%);
        margin-top: 10px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile hero adjustments */
    .hero-pattern {
        min-height: 90vh;
    }
    
    /* Mobile form adjustments */
    .form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile tab buttons */
    .tab-button {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-pattern {
        min-height: 85vh;
    }
    
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* SVG Logo styles */
.logo-svg {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

.logo-svg:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Logo container styles */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Footer logo adjustments */
footer .logo-svg {
    height: 40px;
}

footer .logo-svg circle[fill*="gradient"] {
    fill: url(#footerGradient);
}

footer .logo-svg text {
    fill: white !important;
}

/* Enlarged Logo Styles - 130% size increase for better visibility */
.logo-enlarged {
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* Base height is now h-16 (64px) which is 128% of original h-12.5 (50px) */
}

.logo-enlarged:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Footer logo - keep original colors with gray background compatibility */
footer .logo-container img {
    /* Remove filter to show original logo colors on gray background */
    filter: none;
    /* Keep footer logo at original size for better balance */
    height: 40px !important;
    max-width: 300px !important;
}

/* Responsive adjustments for enlarged logo */
@media (max-width: 1024px) {
    .logo-enlarged {
        /* h-20 = 80px on larger screens, h-16 = 64px on smaller */
        max-width: 420px; /* Increased proportionally */
    }
}

@media (max-width: 768px) {
    .logo-enlarged {
        height: 56px; /* ~130% of original 42px */
        max-width: 380px;
    }
}

@media (max-width: 640px) {
    .logo-enlarged {
        height: 50px; /* ~130% of original 38px */
        max-width: 340px;
    }
}

@media (max-width: 480px) {
    .logo-enlarged {
        height: 42px; /* ~130% of original 32px */
        max-width: 280px;
    }
}

/* Extra small screens - moderate increase to maintain usability */
@media (max-width: 360px) {
    .logo-enlarged {
        height: 36px; /* ~128% of original 28px */
        max-width: 240px;
    }
}

/* Compact header with auto-cropped logo */
header nav {
    min-height: 46px; /* さらに圧縮（SP目安） */
}

@media (min-width: 768px) {
    header nav {
        min-height: 54px; /* さらに圧縮（PC目安） */
    }
}

/* Auto-crop logo image to remove transparent padding */
.logo-enlarged {
    /* Custom cropping to remove vertical padding from logo image */
    object-fit: contain;           /* 文字のつぶれ防止 */
    object-position: center;
    /* 透明余白が多い場合は上下をさらにカット（12%で微調整） */
    clip-path: inset(12% 0 12% 0);
    display: block;                 /* 画像下の行間隙間対策 */
}

/* Smooth header transition on scroll */
header {
    transition: all 0.3s ease;
}

/* Ensure proper vertical alignment */
header .flex.justify-between.items-center {
    min-height: inherit;
}

/* Hero section title optimization for 2-line display */
.hero-title-optimized {
    max-width: 1100px;   /* 横幅を確保して2行に収める */
    margin-inline: auto;
    line-height: 1.28;   /* 行間を少し詰める（1.25-1.3の範囲） */
    word-break: keep-all;
}

/* Responsive font sizes for better 2-line layout */
@media (max-width: 640px) {
    .hero-title-optimized {
        font-size: 1.75rem; /* 28px - smaller on mobile */
        line-height: 1.2;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .hero-title-optimized {
        font-size: 2rem; /* 32px - medium size for tablets */
        line-height: 1.15;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title-optimized {
        font-size: 2.25rem; /* 36px - for larger tablets */
        line-height: 1.15;
    }
}

@media (min-width: 1025px) {
    .hero-title-optimized {
        font-size: 2.5rem; /* 40px - desktop size */
        line-height: 1.1;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* CTA Primary Button - Enhanced with !important for production */
.cta-primary {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 16px 28px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #2f4cff !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.cta-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.25) !important;
}

/* CTA Secondary Button - Enhanced with !important for production */
.cta-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 26px !important;
    border-radius: 14px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* CTA Group Layout - Enhanced with !important for production */
.cta-group {
    display: flex !important;
    gap: 20px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

/* Primary CTA Large Variant - Enhanced with !important for production */
.cta-primary-large {
    padding: 18px 32px !important;
}