/* Common Tool Styles - Base styles used across all tools */
:root {
    --header-text-color: #485C6E;
    --color-grey-50: #F1F1F1;
    --color-grey-300: #A0A0A0;
    --color-grey-700: #505050;
}

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.active-passive-parent-container {
    background-color: var(--color-blue-500);
}

.main-content-wrapper {
    padding: 1.5rem;
}

.content-container {
    background-color: white;
    border: 1px solid var(--color-grey-50);
    box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.12);
    overflow: visible;
}

.header-title {
    font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
    font-weight: 700;
    color: var(--header-text-color);
}

.header-desc {
    font-size: clamp(0.875rem, 1vw + 0.25rem, 1rem);
    font-weight: 400;
    color: var(--header-text-color);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 500px;
}

.separator {
    background-color: var(--color-grey-50);
    margin: auto;
    height: 95%;
    display: none;
    width: 0.15rem;
    margin: 0.5;
}

.input-section,
.output-section {
    padding: 0.5rem;
    border: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-grey-700);
    margin-bottom: 1rem;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    min-height: 250px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    color: #BEBEBE;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #757682;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.856rem;
    color: #757682;
    margin: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.action-btns {
    height: 2.3125rem;
}

.header-action-btns {
    display: flex;
    gap: 0.5rem;
    height: 2.25rem;
}

.btn-primary {
    background: var(--color-primary-light);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--color-primary-dark);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-loading-spinner {
    border: 1px solid #f3f4f6;
    border-top: 1px solid var(--color-primary-light);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

.btn-secondary {
    border: 1px solid var(--color-grey-50);
    box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.12);
    width: 2.25rem;
    height: auto;
    background-color: white;
    color: #485C6E;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0.375rem;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #F9FAFB;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #E5E7EB;
}

.btn-secondary:disabled {
    background-color: #F5F5F5;
    color: #A1A1AA;
    border-color: #E5E5E5;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   INPUT TEXTAREA & FORM ELEMENTS
   ========================================================================== */

.input-group-custom {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #6b7280;
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.char-limit-warning {
    color: #f59e0b;
}

.char-limit-error {
    color: #ef4444;
}

.form-label {
    font-size: 14px;
    font-weight: 700;
    color: #757682;
    margin-bottom: 0.4rem;
}

/* Show '*' mark in red for required labels */
.form-label.required::after {
    content: " *";
    color: red;
    font-weight: 700;
}

/* Show (Optional) in gray for optional labels */
.form-label.optional::after {
    content: " (Optional)";
    font-weight: 400;
    color: #A0A0A0;
}

.resizable-textarea {
    min-height: 100px;
    max-height: 200px;
    resize: vertical;
}

/* ==========================================================================
   RESULT SECTIONS
   ========================================================================== */

.converted-output {
    height: 100%;
    background-color: #f9f9f9;
    border-radius: 0.75rem;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    word-break: break-word;
}

/* For Firefox */
#results-container {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ==========================================================================
   TOAST MESSAGES
   ========================================================================== */

#messageBox {
    position: absolute;
    top: 10%;
    right: 1%;
    z-index: 9999;
    max-width: 40%;
    width: auto;
}

/* ==========================================================================
   INSTAGRAM CAPTION GENERATOR SPECIFIC STYLES
   ========================================================================== */

.instagram-configuration-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Updated Toggle Options Container - Using Text Formatter Style */
.formatting-options-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toggle-container {
    display: flex;
    justify-content: flex-start;
    align-items: start;
    gap: 0.75rem;
    flex-direction: row;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    margin: 0.2rem 0;
    width: clamp(38px, 8vw, 42px);
    height: clamp(20px, 4.5vw, 22px);
    flex-shrink: 0;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-input:checked+.toggle-label {
    background: linear-gradient(135deg, var(--color-primary-light, #3b82f6) 0%, var(--color-primary-dark, #2563eb) 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.toggle-input:focus+.toggle-label {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.toggle-input:checked+.toggle-label:before {
    transform: translateX(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hover effects */
.toggle-label:hover {
    background-color: #cbd5e1;
    transform: scale(1.02);
}

.toggle-input:checked+.toggle-label:hover {
    background: linear-gradient(135deg, var(--color-primary-dark, #2563eb) 0%, #1d4ed8 100%);
}

/* Active state */
.toggle-input:active+.toggle-label:before {
    width: 18px;
}

/* Disabled state */
.toggle-input:disabled+.toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

.toggle-input:disabled+.toggle-label:hover {
    transform: none;
    background-color: #f1f5f9;
}

/* Toggle label text - Using Text Formatter Style */
.toggle-container .form-label,
.toggle-container label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.toggle-container:hover .form-label,
.toggle-container:hover label {
    color: #1f2937;
}

.form-label-description {
    font-size: 12px;
    font-weight: 400;
    color: #717171;
    margin-bottom: 0.4rem;
    margin-top: 0.2rem;
}


.keywords-input-container .keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.remove-keyword {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-keyword:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

.caption-result-card {
    background: #FBFBFD;
    border: 1px solid #F1F1F1;
    border-radius: 12px;
    padding: 1.5rem 1.125rem;
    margin-bottom: 0.7rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.caption-result-card:hover {
    border-color: #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.caption-result-card-header {
    border-bottom: 2px solid #F1F1F1;
    padding-bottom: 0.75rem;
}

.caption-result-card-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text-505050);
    letter-spacing: 0.5px;
    background: #F8F9FA;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #E9ECEF;
}

.caption-result-content {
    padding-top: 0.75rem;
}

.caption-text {
    font-size: 1rem;
    color: #4B5563;
    line-height: 1.6;
    white-space: pre-wrap;
}

.copy-btn {
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.copy-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Enhanced dropdown styles for language search */
.dropdown-container.searchable .dropdown-search {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.dropdown-container.searchable .dropdown-search:focus {
    border-bottom-color: #007bff;
}

.dropdown-item.no-results {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ========================================================================== */

/* Mobile Large (480px+) */
@media (min-width: 480px) {
    .instagram-toggle-container {
        gap: 16px;
    }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .instagram-configuration-container {
        /* gap: 8px; */
    }

    .instagram-options-container {
        padding: 20px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 1rem 1fr;
    }

    .separator {
        display: block;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .instagram-configuration-container {
        /* gap: 8px; */
    }

    .instagram-options-container {
        padding: 12px;
    }

    .caption-result-card {
        padding: 12px;
    }

    .caption-result-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .copy-btn {
        align-self: flex-end;
    }

    #generated-output-result {
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }

    #generated-output-result::-webkit-scrollbar {
        display: none !important;
    }
}