/* Apple-inspired Design System */
:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --background-color: #FFFFFF;
    --surface-color: #F2F2F7;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-color: #D2D2D7;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color 0.2s ease;
}

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

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
}

.hero-title {
    font-size: clamp(24px, 5vw, 56px);
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Timer Creator */
.timer-creator {
    padding: 80px 0;
}

.timer-form h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: var(--background-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Datetime-local input improvements */
.form-group input[type="datetime-local"] {
    cursor: pointer;
    position: relative;
}

.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    background: transparent;
    cursor: pointer;
}

/* Firefox */
.form-group input[type="datetime-local"]::-moz-datetime-reset-button {
    display: none;
}

/* Make entire field clickable */
.form-group input[type="datetime-local"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #4845B8;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Timer Display */
.timer-display {
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 40px auto;
    text-align: center;
}

.timer-display h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.countdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.time-unit {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
}

.time-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.time-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 8px;
}

.timer-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--surface-color);
}

.features h3 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 56px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 64px;
}

.feature-item {
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-item h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* About Section */
.about {
    padding: 80px 0;
}

.about h3 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.about p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 24px;
    text-align: center;
}

/* Footer */
.footer {
    padding: 40px 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

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

.disclaimers {
    max-width: 600px;
    margin: 0 auto;
}

.disclaimer {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Legal Content Styles */
.legal-content {
    padding: 120px 0 80px;
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.legal-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.legal-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.legal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.legal-content ul {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 16px 0;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--secondary-color);
}

.last-updated {
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
    margin-bottom: 32px;
}

.disclaimer-box {
    background: #FFF3CD;
    border: 1px solid #FFEAA7;
    border-radius: 8px;
    padding: 20px;
    margin: 32px 0;
}

.disclaimer-box h3 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 16px;
}

.disclaimer-box ul {
    color: #856404;
}

.disclaimer-box li {
    margin-bottom: 12px;
}

/* Ad Containers - 効果的な配置とサイズ */
.ad-container {
    margin: 20px auto;
    text-align: center;
    background-color: #34C759;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #30A14E;
    position: relative;
}

.ad-container::before {
    content: "広告表示エリア";
    color: white;
    font-weight: 600;
    font-size: 12px;
    display: block;
    margin-bottom: 8px;
}

/* Above-the-fold Ad (最高効果) */
.ad-above-fold {
    padding: 15px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.ad-leaderboard {
    max-width: 728px;
    height: 90px;
}

/* Sidebar Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.timer-form {
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.sidebar-ad {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.ad-rectangle {
    width: 300px;
    height: 250px;
}

/* In-content Ads */
.ad-in-content {
    width: 336px;
    height: 280px;
    margin: 30px auto;
}

/* Native Ad Style */
.ad-native {
    max-width: 728px;
    height: 90px;
    background: transparent;
    border: 1px solid var(--border-color);
    margin: 30px auto;
}

.ad-native::before {
    content: "PR";
    color: var(--text-secondary);
    font-size: 10px;
    position: absolute;
    top: 5px;
    left: 10px;
}

/* Mobile Anchor Ad */
.ad-mobile-anchor {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    padding: 10px;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-ad {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .ad-above-fold {
        padding: 10px 0;
    }
    
    .ad-leaderboard {
        max-width: 320px;
        height: 50px;
    }
    
    .ad-native {
        max-width: 320px;
        height: 50px;
    }
    
    .ad-rectangle {
        width: 300px;
        height: 250px;
    }
    
    .ad-in-content {
        width: 300px;
        height: 250px;
        margin: 20px auto;
    }
    
    .sidebar-ad {
        justify-content: center;
        align-items: center;
        margin-top: 15px;
    }
    
    .ad-mobile-anchor {
        display: block;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .ad-container {
        max-width: 280px;
        padding: 8px;
        margin: 15px auto;
    }
    
    .ad-leaderboard,
    .ad-native {
        width: 280px;
        height: 50px;
    }
    
    .ad-rectangle,
    .ad-in-content {
        width: 280px;
        height: 200px;
    }
    
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: clamp(16px, 7vw, 24px);
        padding: 0 8px;
    }
    
    .hero-subtitle {
        font-size: 13px;
        padding: 0 8px;
    }
    
    .timer-form {
        margin: 0 4px;
        padding: 20px 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        padding: 8px 16px;
    }
    
    .logo {
        font-size: 16px;
        max-width: 150px;
    }
    
    .language-switcher select {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .nav {
        gap: 16px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        padding: 0 16px;
        font-size: clamp(20px, 4vw, 32px);
    }
    
    .hero-subtitle {
        padding: 0 16px;
        font-size: 16px;
    }
    
    .timer-creator,
    .features,
    .about {
        padding: 60px 0;
    }
    
    .timer-form {
        padding: 32px 20px;
        margin: 0 8px;
    }
    
    .countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .time-unit {
        padding: 20px 12px;
    }
    
    .time-value {
        font-size: 36px;
    }
    
    .timer-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-secondary,
    .btn-outline {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header .container {
        padding: 8px 12px;
    }
    
    .logo {
        font-size: 14px;
        max-width: 120px;
    }
    
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero-title {
        font-size: clamp(18px, 6vw, 28px);
        margin-bottom: 16px;
        padding: 0 12px;
    }
    
    .hero-subtitle {
        font-size: 14px;
        padding: 0 12px;
    }
    
    .timer-form {
        margin: 0 4px;
        padding: 24px 16px;
    }
    
    .countdown {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .time-unit {
        padding: 16px 8px;
    }
    
    .time-value {
        font-size: 24px;
    }
    
    .time-label {
        font-size: 12px;
    }
}