/* Common Styles for All Tools */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'メイリオ', sans-serif;
    line-height: 1.8;
    margin: 0 auto;
    color: #333;
    background-color: #f9f9f9;
}

/* Language Switcher Bar */
.language-switcher {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #b8305d 0%, #9a2850 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.home-icon {
    color: white;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.home-icon:hover {
    background: rgba(255,255,255,0.15);
}

.home-icon i {
    width: 20px;
    height: 20px;
}

.user-icon {
    color: white;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.user-icon:hover {
    background: rgba(255,255,255,0.15);
}

.user-icon i {
    width: 20px;
    height: 20px;
}

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

.language-switcher button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.language-switcher button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.language-switcher button.active {
    background: white;
    color: #b8305d;
    border-color: white;
}

/* Main Container */
main {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 20px auto;
}

/* Header */
article header {
    border-bottom: 3px solid #b8305d;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.2em;
    color: #b8305d;
    margin-bottom: 10px;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin: 10px 0;
}

/* Tool Container */
.tool-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    border: 2px solid #e0e0e0;
}

/* Input Groups */
.input-group {
    margin: 20px 0;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #b8305d;
}

.input-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #b8305d;
    color: white;
}

.btn-primary:hover {
    background: #9a2850;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(184,48,93,0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #218838;
}

.btn-copy.copied {
    background: #20c997;
}

/* Output Areas */
.output-group {
    margin: 20px 0;
    display: none;
}

.output-group.show {
    display: block;
}

.output-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-box {
    background: #fff;
    padding: 15px;
    border: 2px solid #b8305d;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 15px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #888;
}

footer a {
    color: #b8305d;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .tool-container {
        padding: 15px;
    }
}
