/* Hyomon Flux style.css */

:root {
    --final-max-height: 500px;
    --input-primary-color: #0577db;
    --background-focus-color: #00000011;
    --hover-color: #bebebe48;
}

body {
    padding-top: 0px;
    margin: 0px;
    width: 100%;
    background-color: rgb(235, 238, 240);
}

/******* ここからメインエリアのスタイル ********/
main {
    text-align: center;
}

#title {
    font-weight: 700;
    color: #3990dc;
    font-size: x-large;
}

.main-view {
    width: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    margin: 60px 0 0 0;
    padding: 0 20px 0 20px;
    gap: 20px;
    box-sizing: border-box;
}

#account {
    display: none !important;
}

/* Flux専用スタイル */
.flux-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    width: 100%;
}

.flux-composer {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.flux-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.flux-textarea:focus {
    outline: none;
    border-color: var(--input-primary-color);
    box-shadow: 0 0 0 2px rgba(5, 119, 219, 0.2);
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.char-count {
    color: #666;
    font-size: 14px;
}

.char-count.warning {
    color: #f39c12;
}

.char-count.error {
    color: #e74c3c;
}

.flux-post {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.flux-post:last-child {
    border-bottom: none;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-display-name {
    font-weight: 600;
    color: #333;
}

.user-handle {
    color: #666;
    font-size: 14px;
}

.post-user-icon img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-time {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

.post-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-content {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 15px;
    white-space: pre-wrap;
    color: #333;
}

.post-actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--hover-color);
}

.action-btn.liked {
    color: #e74c3c;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #f5f5f5;
}

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

.setup-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.setup-form h2 {
    color: #333;
    margin-bottom: 10px;
}

.setup-form>p {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--input-primary-color);
    box-shadow: 0 0 0 2px rgba(5, 119, 219, 0.2);
}

.input-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.3;
}

.setup-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.usage-stats {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.welcome-message {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* 一時的なメッセージのスタイル */
.temp-message {
    font-size: 14px;
    font-weight: 500;
}

.flex-account-view {
    z-index: 0;
    box-shadow: 0px 0px 5px 2px #0000001d;
    width: 300px;
    height: calc(100% - 10px);
    max-height: 220px;
    border-radius: 20px;
    background-color: #ffffff;
    font-size: larger;
    margin-right: auto;
    margin-left: auto;
    display: flex;
    flex-direction: column;

    .container {
        z-index: 1;
        width: 300px;
        border-radius: 0px 0px 20px 20px;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: auto;

        .profile {
            display: flex;
            flex-direction: row;
            align-items: center;
            padding: 30px 20px 20px 20px;
            box-sizing: border-box;
            width: 100%;
            gap: 15px;

            .account-view-icon img {
                cursor: pointer;
                border-radius: 50%;
                width: 60px;
                height: 60px;
                background-color: white;
            }

            .info {
                display: flex;
                flex-direction: column;
                flex-grow: 1;
                max-width: calc(100% - 80px);

                .account-view-name {
                    width: 100%;

                    p {
                        cursor: default;
                        font-size: large;
                        font-weight: 600;
                        width: 100%;
                        margin: 0px;
                        color: #3b3b3b;
                        margin-bottom: 8px;
                        text-overflow: ellipsis;
                        overflow: hidden;
                        white-space: nowrap;
                        font-family: 'Inter', 'Noto Sans JP';
                    }
                }

                .account-view-handle {
                    width: 100%;

                    p {
                        cursor: default;
                        font-size: smaller;
                        width: 100%;
                        margin: 0px;
                        color: #646464;
                        text-overflow: ellipsis;
                        overflow: hidden;
                        white-space: nowrap;
                        font-family: 'Outfit', 'Noto Sans';
                    }
                }
            }



            .account-view-icon img::after {
                content: '<span class="material-symbols-outlined"></span>';
            }
        }

        .options {
            flex-grow: 1;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 10px;

            .option {
                width: calc(100% - 20px);
                display: flex;
                align-items: center;
                justify-content: center;
                padding: 10px;
                box-sizing: border-box;
                border-radius: 10px;
                cursor: pointer;
                background-color: #eff3f5;

                p {
                    color: #3b3b3b;
                    font-size: medium;
                    margin: 0;
                }

                span {
                    color: #3b3b3b;
                }

                &:hover {
                    background-color: #e6eaec;
                }
            }
        }
    }
}

.legal-info {
    font-size: small;

    p,
    a {
        margin: 5px 0px;
        color: #7a7a7a !important;
    }
}

.flux-account-view-frame {
    width: 325px;
    position: fixed;
    right: 10px;
    top: 60px;
    z-index: 9999;
    transform-origin: top right;

    &.closing {
        animation: appFadeOut 0.1s ease-out forwards;
    }
}

.splash {
    position: fixed;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--background-color);
    z-index: 5000;
    top: 0px;
    left: 0px;

    img {
        width: 100px;
        height: 100px;
    }

    &.closing {
        animation: fadeOut 0.2s ease-out forwards;

        img {
            animation: zoomInBig 0.15s ease-out forwards;
        }
    }

    .splash-progress {
        margin-top: 20px;
        width: 100px;
        height: 8px;
        background-color: #e4f1f5;
        border-radius: 4px;
        overflow: hidden;
        position: relative;

        .progress-value {
            position: absolute;
            transition: width 0.3s ease-in-out;
            height: 8px;
            background-color: #2389cd;
            border-radius: 4px;
            width: 0;
            margin: 0;
            padding: 0;
        }
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .setup-form {
        padding: 20px;
    }

    .form-group input {
        font-size: 16px;
        /* iOS Safari で拡大を防ぐ */
    }

    .flux-container {
        margin: 0;
        padding: 15px;
        box-sizing: border-box;
    }

    .main-view {
        padding: 0;
    }
}