/* interType-CT — 19 interType page styles
// ===================================================================================
// All styles for the interType AI assistant page.
// Extracted from inter_type.html.erb inline styles for modular organization.
// =================================================================================== */

/* interType logo */

.interType-logo-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.interType-logo {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(255, 140, 66, 0.4);
}

/* theme toggle */

.interType-theme-btn {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 200;
    padding: 8px 12px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #ff8c42;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 140, 66, 0.3);
    transition: all 0.2s ease;
}

.interType-theme-btn:hover {
    transform: scale(1.1);
    border-color: #ff3c7f;
    background: rgba(255, 255, 255, 1);
}

/* dark mode */

#interType-page[data-theme="dark"] {
    background: radial-gradient(
        ellipse at top,
        #1a1025 0%,
        #0d0615 40%,
        #1a0a2e 100%
    );
}

#interType-page[data-theme="dark"] .interType-theme-btn {
    background: rgba(30, 20, 50, 0.8);
    border-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-header {
    border-bottom-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-back {
    background: rgba(30, 20, 50, 0.7);
    color: #ff8c42;
}

#interType-page[data-theme="dark"] .interType-chat-panel {
    background: rgba(20, 10, 40, 0.6);
    border-color: #ff3c7f;
    box-shadow: 0 4px 24px rgba(255, 60, 127, 0.3);
}

#interType-page[data-theme="dark"]
    .interType-messages::-webkit-scrollbar-track {
    background: rgba(255, 60, 127, 0.15);
}

#interType-page[data-theme="dark"] .interType-msg.interType-bot {
    background: linear-gradient(135deg, #2a1a4e, #1a0a2e);
    color: #ffe0b2;
    border-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-msg.interType-typing {
    background: linear-gradient(135deg, #1a0a2e, #2a1a4e);
    color: #ffb3b3;
    border-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-input-form {
    background: linear-gradient(135deg, #1a0a2e, #0d0015);
    border-top-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-input {
    background: rgba(30, 20, 50, 0.9);
    color: #fff;
    border-color: #ff3c7f;
}

#interType-page[data-theme="dark"] .interType-input::placeholder {
    color: #cc99aa;
}

#interType-page[data-theme="dark"] .interType-read-btn {
    background: rgba(255, 60, 127, 0.4);
    border-color: rgba(255, 60, 127, 0.6);
}

/* interType page */

#interType-page {
    min-height: 100vh;
    background: radial-gradient(
        ellipse at top,
        #fff5e6 0%,
        #ffe0b2 40%,
        #ffb3b3 100%
    );
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.interType-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* header */

.interType-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 10px;
    border-bottom: 3px solid #ff8c42;
    flex-shrink: 0;
}

.interType-back {
    font-size: 18px;
    font-weight: bold;
    color: #ff3c7f;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    margin: 8px 0;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
    white-space: nowrap;
}

.interType-back:hover {
    transform: scale(1.06);
    background: rgba(255, 140, 66, 0.3);
}

.interType-title {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b35, #ff3c7f, #ff1493);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    flex: 1;
    animation: titleGradient 4s ease-in-out infinite;
}

@keyframes titleGradient {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.interType-paws {
    font-size: 28px;
    animation: wiggle 1.5s ease-in-out infinite;
}

@keyframes wiggle {
    0%,
    100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-8deg);
    }
    75% {
        transform: rotate(8deg);
    }
}

/* chat panel */

.interType-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 12px;
    margin-bottom: 16px;
    border: 3px solid #ff8c42;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 24px rgba(255, 140, 66, 0.3);
}

/* messages area */

.interType-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* individual messages */

.interType-msg {
    position: relative;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 16px;
    line-height: 1.45;
    word-wrap: break-word;
    animation: msgFadeIn 0.35s ease-out;
}

.interType-msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0.8;
}

.interType-msg-avatar img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: block;
    object-fit: cover;
}

.interType-bot .interType-msg-header {
    color: #ff8c42;
}

.interType-user .interType-msg-header {
    color: #ffe0b2;
}

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

.interType-msg p {
    margin: 0;
}

.interType-msg.interType-bot {
    align-self: flex-start;
    background: linear-gradient(135deg, #fff5e6, #ffe0b2);
    color: #5a2d0c;
    border: 2px solid #ffb3b3;
    border-bottom-left-radius: 4px;
}

.interType-msg.interType-typing {
    align-self: flex-start;
    background: linear-gradient(135deg, #ffe8cc, #ffd4a3);
    color: #8a4b0f;
    border: 2px solid #ffb3b3;
    border-bottom-left-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
}

.interType-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.interType-typing-dots span {
    width: 6px;
    height: 6px;
    background: #ff8c42;
    border-radius: 50%;
    animation: typingDot 1.2s ease-in-out infinite;
}

.interType-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.interType-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.interType-msg.interType-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff6b6b, #ff3c7f);
    color: white;
    border: 2px solid #ff1493;
    border-bottom-right-radius: 4px;
}

/* message label */

.interType-label {
    font-size: 12px;
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    opacity: 0.7;
}

.interType-content {
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* input form */

.interType-input-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 2px solid #ffb3b3;
    background: linear-gradient(135deg, #fff5e6, #ffe0b2);
    border-radius: 0 0 14px 14px;
    flex-shrink: 0;
}

.interType-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
    border: 2.5px solid #ff8c42;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    box-sizing: border-box;
}

.interType-input:focus {
    transform: scale(1.02);
    box-shadow:
        0 0 14px rgba(255, 140, 66, 0.5),
        0 0 28px rgba(255, 60, 127, 0.2);
    border-color: #ff3c7f;
}

.interType-input::placeholder {
    color: #cc9966;
    font-style: italic;
}

.interType-send-btn {
    padding: 12px 18px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #ff3c7f, #ff1493);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 60, 127, 0.4);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    animation: titleGradient 4s ease-in-out infinite;
}

.interType-send-btn:hover {
    transform: scale(1.07);
    box-shadow:
        0 6px 24px rgba(255, 60, 127, 0.6),
        0 0 40px rgba(255, 107, 107, 0.3);
}

.interType-send-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 60, 127, 0.4);
}

.interType-stop-btn {
    padding: 12px 16px;
    font-size: 18px;
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.interType-stop-btn[hidden] {
    display: none;
}

.interType-stop-btn:hover {
    transform: scale(1.07);
    box-shadow:
        0 6px 24px rgba(192, 57, 43, 0.6),
        0 0 40px rgba(255, 107, 107, 0.3);
}

.interType-stop-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.4);
}

.interType-read-btn {
    position: absolute;
    bottom: 4px;
    right: 6px;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    background: rgba(255, 140, 66, 0.6);
    border: 1px solid rgba(255, 140, 66, 0.8);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.interType-copy-btn {
    right: 34px;
}

.interType-edit-btn {
    right: 6px;
}

.interType-msg:hover .interType-read-btn {
    opacity: 1;
}

.interType-read-btn:hover {
    background: rgba(255, 60, 127, 0.8);
    border-color: #ff3c7f;
}

.interType-read-btn.reading {
    opacity: 1;
    background: rgba(255, 60, 127, 0.9);
    border-color: #ff3c7f;
}

/* typing dot animation */

.interType-typing {
    padding: 12px 18px;
}

.interType-typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.interType-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff8c42;
    animation: interTypeBlink 1.4s infinite ease-in-out both;
}

.interType-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.interType-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.interType-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes interTypeBlink {
    0%,
    80%,
    100% {
        transform: scale(0.4);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.interType-sidebar-btn.auto-read-on {
    border-color: #ff3c7f;
    background: linear-gradient(135deg, #3a2a5e, #2a1a4e);
}

/* mobile responsive */

@media (max-width: 600px) {
    .interType-container {
        padding: 0 8px;
        margin-left: 0;
        max-width: 100vw;
    }

    .interType-title {
        font-size: 24px;
    }

    .interType-msg {
        max-width: 90%;
        font-size: 15px;
    }

    .interType-input {
        font-size: 15px;
        padding: 10px 12px;
    }

    .interType-send-btn {
        padding: 10px 14px;
        font-size: 18px;
    }

    .interType-stop-btn {
        padding: 10px 12px;
        font-size: 16px;
    }

    .interType-sidebar {
        width: 200px;
        transform: translateX(-200px);
    }

    .interType-sidebar.open {
        transform: translateX(0);
    }
}

/* scrollbar styling for chat */

.interType-messages::-webkit-scrollbar {
    width: 8px;
}

.interType-messages::-webkit-scrollbar-track {
    background: rgba(255, 224, 178, 0.4);
    border-radius: 4px;
}

.interType-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff8c42, #ff3c7f);
    border-radius: 4px;
}

/* ===================================================================================
 * LEFT SIDEBAR TOOLBAR
 * =================================================================================== */

.interType-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(180deg, #1a0a2e 0%, #0d0015 100%);
    border-right: 3px solid #ff8c42;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.interType-sidebar.collapsed {
    transform: translateX(-220px);
}

.interType-sidebar-toggle {
    position: fixed;
    left: 0;
    top: 16px;
    width: 36px;
    height: 36px;
    background: #ff8c42;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(255, 140, 66, 0.4);
    transition:
        transform 0.2s ease,
        left 0.3s ease;
    z-index: 101;
}

.interType-sidebar-toggle:hover {
    transform: scale(1.1);
    background: #ff3c7f;
}

/* Move toggle right when sidebar is open */
.interType-sidebar-toggle.sidebar-open {
    left: 220px;
}

.interType-sidebar-tools {
    padding: 60px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.interType-sidebar-btn {
    padding: 10px 12px;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2a1a4e, #1a0a2e);
    border: 2px solid #ff8c42;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: system-ui, sans-serif;
}

.interType-sidebar-btn:hover {
    transform: translateX(4px);
    border-color: #ff3c7f;
    background: linear-gradient(135deg, #3a2a5e, #2a1a4e);
}

.interType-sidebar-btn:active {
    transform: scale(0.96);
}

.interType-sidebar-sep {
    height: 2px;
    background: rgba(255, 140, 66, 0.3);
    margin: 8px 0;
}

.interType-sidebar-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: system-ui, sans-serif;
}

/* Adjust container for sidebar */
.interType-container {
    margin-left: 220px;
    max-width: calc(100vw - 220px);
}

.interType-sidebar-history {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px;
}

.interType-sidebar-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    padding: 6px;
    text-align: center;
    font-style: italic;
}

.interType-history-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.interType-history-item {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #2a1a4e, #1a0a2e);
    border: 1px solid #ff8c42;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.interType-history-item:hover {
    transform: translateX(4px);
    border-color: #ff3c7f;
    background: linear-gradient(135deg, #3a2a5e, #2a1a4e);
}

.interType-history-item.active {
    border-color: #ff3c7f;
    background: linear-gradient(135deg, #4a3a6e, #3a2a5e);
}

/* sidebar scrollbar */
.interType-sidebar-tools::-webkit-scrollbar,
.interType-sidebar-history::-webkit-scrollbar {
    width: 6px;
}

.interType-sidebar-tools::-webkit-scrollbar-track,
.interType-sidebar-history::-webkit-scrollbar-track {
    background: rgba(255, 140, 66, 0.1);
    border-radius: 3px;
}

.interType-sidebar-tools::-webkit-scrollbar-thumb,
.interType-sidebar-history::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff8c42, #ff3c7f);
    border-radius: 3px;
}

/* interType knows list */

.interType-knows {
    padding-left: 20px;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: #5a2d0c;
}

.interType-knows li {
    margin-bottom: 2px;
}

/* interType button */

#inter_type-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #6c5ce7, #a855f7, #ff3c7f);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    animation: titleGradient 4s ease-in-out infinite;
}

#inter_type-btn:hover {
    transform: scale(1.07);
    box-shadow:
        0 6px 24px rgba(168, 85, 247, 0.6),
        0 0 40px rgba(108, 92, 231, 0.3);
}

#inter_type-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.interType-history-menu {
    padding: 2px 6px;
    font-size: 16px;
    color: #fff;
    background: rgba(255, 140, 66, 0.3);
    border: 1px solid rgba(255, 140, 66, 0.5);
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.interType-history-menu:hover {
    background: rgba(255, 60, 127, 0.6);
    border-color: #ff3c7f;
}

.interType-history-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: linear-gradient(135deg, #1a0a2e, #0d0015);
    border: 1px solid #ff8c42;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 120px;
}

.interType-history-dropdown button {
    padding: 6px 8px;
    font-size: 12px;
    color: #fff;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.interType-history-dropdown button:hover {
    background: rgba(255, 60, 127, 0.3);
}

.interType-history-dropdown[hidden] {
    display: none !important;
}
