:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.6);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --primary: #58a6ff;
    --primary-hover: #3182ce;
    --accent: #bc8cff;
    --highlight: #3fb950;
    --transition: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding-top: 80px; /* ナビゲーションバーの分の余白 */
    padding-bottom: 2rem;
}

/* --- Global Navigation --- */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    margin-right: 2rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}


/* Background Animated Orbs */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 10;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.app-header p {
    color: var(--text-muted);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Drop Zone */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--panel-border);
    border-radius: 16px;
    padding: 4rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(88, 166, 255, 0.05);
    transform: translateY(-2px);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.drop-zone:hover .icon-upload {
    transform: translateY(-5px) scale(1.1);
}

/* Edit Section */
.edit-area {
    animation: fadeIn 0.5s ease;
}

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

.preview-container {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#image-preview {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.file-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-info .arrow {
    color: var(--primary);
}

.file-info .highlight {
    color: var(--highlight);
    font-weight: 600;
}

/* Controls */
.controls {
    margin-bottom: 2rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.format-selector .radio-buttons {
    display: flex;
    gap: 1rem;
}

.radio-buttons input[type="radio"] {
    display: none;
}

.radio-buttons label {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: normal;
}

.radio-buttons input[type="radio"]:checked + label {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* Buttons */
.actions {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.6);
}


@media (max-width: 480px) {
    .app-header h1 {
        font-size: 2.5rem;
    }
    .actions {
        flex-direction: column;
    }
}

/* --- AdSense Placeholders --- */
.ad-container {
    width: 100%;
    max-width: 728px; /* Standard ad banner max width */
    min-height: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    z-index: 10;
}

.ad-placeholder-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- App 2: PassGen Styles --- */
.password-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-family: 'Roboto Mono', monospace; /* Monospace for passwords */
}

#generated-password {
    font-size: 1.5rem;
    word-break: break-all;
    color: var(--text-muted);
    transition: var(--transition);
}

#generated-password.generated {
    color: var(--highlight);
    text-shadow: 0 0 10px rgba(63, 185, 80, 0.3);
}

.btn-copy {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
    border-radius: 8px;
}

.btn-copy:hover {
    color: var(--primary);
    background: rgba(88, 166, 255, 0.1);
}

.options-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.seo-text {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--panel-border);
}

.seo-text h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.seo-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.copy-msg {
    text-align: center;
    color: var(--highlight);
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
    min-height: 20px;
}

/* --- Global Form Styles (Inputs / Textareas) --- */
.modern-input, .modern-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: none;
    transition: var(--transition);
}

.modern-input:focus, .modern-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
}

.modern-textarea {
    height: 150px;
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.btn-copy-small {
    padding: 0 1rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-copy-small:hover {
    background: rgba(255,255,255,0.2);
}

.font-mono {
    font-family: 'Roboto Mono', monospace;
}

.font-bold {
    font-weight: 600;
}

.d-block {
    display: block;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-highlight { color: var(--highlight); }

.center-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- App Specific: CharCount --- */
.counter-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- App Specific: QRForge --- */
.qr-container {
    display: flex;
    justify-content: center;
    background: rgba(255,255,255, 1);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.color-picker {
    height: 40px;
    width: 100%;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: none;
}
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border-radius: 8px; border: 1px solid rgba(0,0,0,0.2); }

/* --- App Specific: ColorSync --- */
.color-preview {
    height: 150px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #3fb950;
    transition: background 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
#main-color-picker {
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* --- App Specific: PomoTimer --- */
.timer-mode-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.mode-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.timer-display {
    font-size: 6rem;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}
.btn-large {
    font-size: 1.2rem;
    padding: 1rem 3rem;
    border-radius: 30px;
}

/* --- App Specific: IO Layout (Base64/JSON) --- */
.app-wide {
    max-width: 800px; /* Wider container for 2 columns */
}
.io-grid {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.io-col {
    flex: 1;
}
.io-arrow {
    font-size: 2rem;
    color: var(--text-muted);
}
@media (max-width: 600px) {
    .io-grid { flex-direction: column; }
    .io-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
}

/* --- App Specific: GradGen --- */
.gradient-preview {
    height: 200px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.color-stops {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.color-picker-large {
    width: 60px;
    height: 60px;
    border: none;
    background: none;
    cursor: pointer;
}
.color-picker-large::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-large::-webkit-color-swatch { border-radius: 50%; border: 3px solid #fff; }

/* --- App Specific: JSONBeautify --- */
.error-box {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
}
