/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

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

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    color: #4a6cf7;
    font-size: 24px;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: #4a6cf7;
    background-color: #f0f4ff;
}

nav ul li a.active {
    color: #4a6cf7;
    background-color: #f0f4ff;
}

/* Main Content Styles */
main {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

.tool-section {
    display: none;
    padding: 20px 0;
}

.tool-section.active {
    display: block;
}

section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    text-align: center;
}

/* Chat Styles */
select {
    width: 20%;
    padding: 8px;
    font-size: 12px;
    border: 2px solid #90caf9;
    background-color: #f1f8ff;
    color: #333;
    transition: border-color 0.3s ease;
  }

  .result {
    font-size: 13px;
    color: #555;
    background: #e3f2fd;
    padding: 8px;
    min-height: 40px;
  }
.chat-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.bot {
    align-items: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background-color: #4a6cf7;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.message.bot .message-content {
    background-color: #f0f4ff;
    color: #333;
    border-bottom-left-radius: 5px;
}

.chat-input {
    display: flex;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.chat-input textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 15px;
    resize: none;
    height: 50px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s ease;
}

.chat-input textarea:focus {
    border-color: #4a6cf7;
}

.chat-input button {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #3a5ce5;
}

/* Image Generator Styles */
.image-generator-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.prompt-input {
    margin-bottom: 20px;
}

.prompt-input textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    resize: none;
    height: 100px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s ease;
    margin-bottom: 15px;
}

.prompt-input textarea:focus {
    border-color: #4a6cf7;
}

.image-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.image-options select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
}

.prompt-input button {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.prompt-input button:hover {
    background-color: #3a5ce5;
}

.image-results {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.image-output {
    width: 100%;
    min-height: 300px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
}

.placeholder-text {
    color: #999;
    text-align: center;
}

.generated-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Tools Grid Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tool-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    font-size: 30px;
    color: #4a6cf7;
    margin-bottom: 15px;
}

.tool-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.tool-card p {
    color: #666;
    font-size: 14px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 800px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

#modal-title {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

#modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Footer Styles */
footer {
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    text-align: center;
}

footer p {
    color: #666;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }

    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 576px) {
    .message-content {
        max-width: 85%;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Add these new styles to the end of your existing CSS file */

/* API Status Styles */
.api-status {
    background-color: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
}

.api-warning {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #fff3cd;
    border-radius: 5px;
    color: #856404;
}

.api-warning i {
    font-size: 20px;
    margin-right: 10px;
}

.api-warning p {
    flex: 1;
}

#setup-api-btn {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 15px;
}

#setup-api-btn:hover {
    background-color: #3a5ce5;
}

/* API Setup Modal Styles */
.api-setup-modal {
    line-height: 1.6;
}

.api-setup-modal p {
    margin-bottom: 15px;
}

.api-setup-modal ol, .api-setup-modal ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.api-setup-modal li {
    margin-bottom: 5px;
}

.api-keys-list {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.api-keys-list h3 {
    margin-bottom: 10px;
    color: #333;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin: 20px auto;
}

.loading-spinner div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #4a6cf7;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-spinner div:nth-child(1) {
    left: 8px;
    animation: loading-spinner1 0.6s infinite;
}

.loading-spinner div:nth-child(2) {
    left: 8px;
    animation: loading-spinner2 0.6s infinite;
}

.loading-spinner div:nth-child(3) {
    left: 32px;
    animation: loading-spinner2 0.6s infinite;
}

.loading-spinner div:nth-child(4) {
    left: 56px;
    animation: loading-spinner3 0.6s infinite;
}

@keyframes loading-spinner1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading-spinner3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes loading-spinner2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 6px 12px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #4a6cf7;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.4;
    animation: typing 1s infinite;
}

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

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

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

@keyframes typing {
    0% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.4; transform: scale(1); }
}

/* Error Messages */
.error-message {
    background-color: #fff0f0;
    border-left: 4px solid #ff3b30;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    color: #d63031;
}

.error-message i {
    margin-right: 8px;
}

.error-help {
    font-size: 14px;
    margin-top: 8px;
    color: #666;
}

/* Image Controls */
.image-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 70px;
}

.image-controls button {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.image-controls button:hover {
    background-color: #3a5ce5;
}

/* Speech to Text Styles */
.speech-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.record-btn {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    margin-bottom: 10px;
}

.record-btn:hover {
    background-color: #3a5ce5;
}

.recording-status {
    font-size: 14px;
    color: #666;
}

.recording-status.active {
    color: #e74c3c;
    font-weight: bold;
}

.recording-status.processing {
    color: #f39c12;
    font-weight: bold;
}

/* Sentiment Analysis Styles */
.sentiment-result {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.sentiment-bars {
    margin-top: 15px;
}

.sentiment-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.sentiment-bar .label {
    width: 80px;
    font-size: 14px;
}

.bar-container {
    flex: 1;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar {
    height: 100%;
    border-radius: 10px;
}

.bar.positive {
    background-color: #2ecc71;
}

.bar.neutral {
    background-color: #3498db;
}

.bar.negative {
    background-color: #e74c3c;
}

.percent {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Code Block Styles */
.code-block {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 15px 0;
}

.copy-code-btn {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    margin-top: 10px;
}

.copy-code-btn:hover {
    background-color: #3a5ce5;
}

/* Audio Player Styles */
.audio-player {
    width: 100%;
    margin: 15px 0;
}

.download-audio-btn {
    background-color: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.download-audio-btn:hover {
    background-color: #3a5ce5;
}

/* Result Content Styles */
.result-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.result-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.style-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.style-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.style-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.style-checkbox:hover input ~ .checkmark {
    background-color: #ccc;
}

.style-checkbox input:checked ~ .checkmark {
    background-color: #4a6cf7;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.style-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.style-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.provider-options {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.provider-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 5px 0;
}

.provider-buttons::-webkit-scrollbar {
    display: none;
}

.provider-btn {
    background-color: #f0f4ff;
    color: #333;
    border: 1px solid #c3d1ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    display: inline-flex;         /* Important */
    align-items: center;          /* Center text vertically */
    justify-content: center;
    width: auto !important;       /* Override any full width */
}
.provider-btn {
    position: relative;
    background-color: #f0f4ff;
    color: #333;
    border: 1px solid #c3d1ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
}

.provider-btn.active {
    background-color: #4a6cf7;
    color: white;
    border-color: #4a6cf7;
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.4);
}

/* ✔ Tick mark badge */
.provider-btn.active::after {
    content: '✔';
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #fff;
    color: #4a6cf7;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}
