/* ============================================ */
/* BASIC TOOL LAYOUT (SHARED ACROSS ALL TOOLS) */
/* ============================================ */

/* Core Tool Page Structure */
.tool-page {
    padding: 40px 0;
    min-height: calc(100vh - var(--header-height, 60px) - var(--footer-height, 200px));
    background: var(--body-bg-gradient);
    color: var(--dark-text);
    transition: var(--transition);
}

.tool-layout-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1400px;
    margin: 70px auto 0;
    padding: 20px;
}

.tool-section {
    flex-grow: 1;
    max-width: 900px;
    /*background: var(--tool-card-bg);
    border: var(--home-tool-card-border);
    border-radius: 12px;
    box-shadow: var(--tool-card-shadow);*/
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
   /* gap: 30px;*/
    padding: 25px;
    transition: var(--transition);
}

/* Tool Header Components */
.tool-header {
    text-align: center;
    position: relative;
}

.tool-title {
    font-size: 2.8em;
    margin-bottom: 10px;
    background: var(--hero-heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.tool-title-text {
    text-align: center;
}

.tool-subtitle{
    margin-bottom: 20px;
    opacity: 0.8;
    color: var(--dark-accent);
}

/* Token Display System */
.token-display-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: help;
    transition: transform 0.2s ease;
    border-radius: 8px;
    padding: 4px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    /* Override parent's transparent text for token display */
    -webkit-text-fill-color: initial;
    color: initial;
}

/* Override wc-tooltip position for token display wrapper */
/* This ensures token div maintains absolute positioning even when wc-tooltip class is applied */
/* The wc-tooltip class normally has position: relative, which breaks token positioning */
.token-display-wrapper.wc-tooltip {
   /* position: absolute !important;*/
}


.token-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    font-size: 0.45em;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    /* Override parent's transparent text for token display */
    -webkit-text-fill-color: initial;
    color: initial;
}

.token-icon {
    font-size: 0.9em;
    line-height: 1;
    /* Override parent's transparent text */
    -webkit-text-fill-color: initial;
    color: initial;
}

.token-count {
    font-weight: 700;
    min-width: 1.2em;
    text-align: center;
    /* Override parent's transparent text */
    -webkit-text-fill-color: initial;
    color: initial;
}

.token-unit {
    font-size: 0.7em;
    opacity: 0.8;
    /* Override parent's transparent text */
    -webkit-text-fill-color: initial;
    color: initial;
}

/* Token Color Coding */
.token-green {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.token-yellow {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
}

.token-red {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Token refill animation */
.token-refill {
    animation: token-refill-flash 0.5s ease-out;
}

@keyframes token-refill-flash {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Light mode adjustments */
.light-mode .token-indicator {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .token-green {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.light-mode .token-yellow {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.light-mode .token-red {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.tool-description {
    font-size: 1.1em;
    color: var(--dark-text);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.9;
}

/* Tool Card Container */
.tool-card-specific {
    
    padding: 30px;
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: var(--transition);
}

/* Form Elements (Shared) */
.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark-text);
    transition: var(--transition);
    text-align: center;
}

.tool-textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background-color: var(--contact-input-bg);
    color: var(--dark-text);
    font-size: 1em;
    resize: vertical;
    min-height: 200px;
    font-family: 'Arial', sans-serif;
    transition: var(--transition);
}

.tool-textarea:focus {
    outline: none;
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(106, 156, 137, 0.3);
}

/* Buttons (Shared) */
.btn-wrapper{
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}


/* Advertisement Styles (Shared) */
.ad-block {
    flex-shrink: 0;
    width: 250px;
    min-height: 600px;
    background-color: var(--home-tool-card-bg);
    border: var(--home-tool-card-border);
    border-radius: 10px;
    padding: 10px;
    box-shadow: var(--tool-card-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--dark-text);
    font-size: 0.9em;
    opacity: 0.8;
    transition: var(--transition);
}

.ad-section-header-banner,
.ad-section-footer-banner {
    text-align: center;
    margin: 20px auto;
    padding: 10px;
    background: var(--tool-card-bg);
    border: var(--home-tool-card-border);
    border-radius: 8px;
    box-shadow: var(--tool-card-shadow);
    max-width: 900px;
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
}

.ad-middle-section {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background: var(--tool-card-bg);
    border: var(--home-tool-card-border);
    border-radius: 8px;
    box-shadow: var(--tool-card-shadow);
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
    padding: 10px;
}

.ad-placeholder-generic {
    width: 100%;
    height: 100%;
    min-height: 90px;
    background-color: rgba(128, 128, 128, 0.1);
    border: 1px dashed rgba(128, 128, 128, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(128, 128, 128, 0.8);
    font-size: 0.9em;
    text-align: center;
    box-sizing: border-box;
}

/* Utility Classes (Shared) */
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* Light Mode Overrides (Shared) */
.light-mode {
    .ad-placeholder {
        border-color: rgba(0, 0, 0, 0.15);
        color: rgba(0, 0, 0, 0.4);
    }
    
    .tool-textarea {
        border-color: rgba(0, 0, 0, 0.1);
        background-color: var(--contact-input-bg);
        color: var(--light-text);
    }
    
    .tool-textarea::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }
    
    .ad-section-header-banner,
    .ad-section-footer-banner,
    .ad-middle-section {
        background: var(--tool-card-bg);
        border: var(--home-tool-card-border);
        box-shadow: var(--tool-card-shadow);
    }
    
    .ad-placeholder-generic {
        background-color: rgba(200, 200, 200, 0.1);
        border: 1px dashed rgba(150, 150, 150, 0.5);
        color: rgba(100, 100, 100, 0.8);
    }
}

/* Responsive Adjustments (Shared) */
@media (max-width: 1200px) {
    .tool-layout-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
        padding: 15px;
    }

    .ad-block {
        width: 320px;
        min-height: 280px;
        order: 3;
    }

    .tool-section {
        max-width: 900px;
        width: 100%;
        order: 1;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .tool-page {
        padding: 30px 0;
    }

    .tool-layout-container {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    .ad-block {
        width: 100%;
        max-width: 320px;
        min-height: 100px;
        margin-bottom: 20px;
    }
    
    .left-ad { order: 1; }
    .tool-section {
        width: 100%;
        max-width: none;
        padding: 15px;
        order: 2;
    }
    .right-ad { order: 3; }

    .tool-title {
        font-size: 2.2em;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }

    .tool-title-text {
        order: 1;
    }

    .token-display-wrapper {
        order: 2;
        align-self: center;
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        /* Override parent's transparent text for token display */
        -webkit-text-fill-color: initial;
        color: initial;
    }

    .token-indicator {
        
        padding: 5px 8px;
        /* Override parent's transparent text for token display */
        -webkit-text-fill-color: initial;
        color: initial;
    }

    .tool-description {
        font-size: 1em;
    }
    .tool-card {
        padding: 25px;
    }
    .tool-textarea {
        min-height: 180px;
    }
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }
    
    .ad-section-header-banner,
    .ad-section-footer-banner {
        margin: 15px auto;
        padding: 8px;
        max-width: 100%;
    }
    .ad-middle-section {
        margin: 10px 0;
        padding: 8px;
    }
    .ad-placeholder-generic {
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .tool-page {
        padding: 20px 0;
    }
    .tool-layout-container {
        padding: 5px;
    }
    .tool-section {
        padding: 10px;
    }
    .tool-title {
        font-size: 1.8em;
        gap: 8px;
    }

    .token-indicator {
        font-size: 0.8em;
        padding: 4px 6px;
        /* Override parent's transparent text for token display */
        -webkit-text-fill-color: initial;
        color: initial;
    }

    .token-icon {
        font-size: 1em;
        /* Override parent's transparent text */
        -webkit-text-fill-color: initial;
        color: initial;
    }

    .tool-description {
        font-size: 0.9em;
    }
    .tool-card {
        padding: 20px;
    }
    .tool-textarea {
        min-height: 150px;
        font-size: 0.95em;
    }
}

/* ============================================ */
/* TEMPLATE SECTIONS STYLES (FAQ, HOW-TO, RELATED TOOLS) */
/* ============================================ */

/* Section Header (Shared) */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--hero-heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--dark-text);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* FAQ Section Styles (Exact copy from home.css) */
.faq-section {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
    margin-bottom: 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--dark-text);
    opacity: 0.9;
}

.faq-item.active .faq-answer {
    padding: 0 2rem 1.5rem;
    max-height: 300px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* How to Use Section Styles */
.how-to-use-section {
    max-width: 900px;
    margin: 0 auto;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    transition: var(--transition);
}

.step-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.step-number-use {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(106, 156, 137, 0.3);
}

.step-content {
    flex: 1;
}

.step-content p {
    font-size: 1.1rem;
    color: var(--dark-text);
    line-height: 1.6;
    margin: 0;
}

/* Related Tools Section Styles */
.related-tools-section {
    max-width: 900px;
    margin: 0 auto;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.related-tool-card {
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.related-tool-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.related-tool-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 4px 15px rgba(106, 156, 137, 0.3);
}

.related-tool-content {
    flex: 1;
}

.related-tool-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.related-tool-content h3 a {
    color: var(--dark-text);
    text-decoration: none;
    transition: var(--transition);
}

.related-tool-content h3 a:hover {
    color: var(--primary-medium);
}

.related-tool-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--dark-text);
    opacity: 0.8;
    line-height: 1.4;
}

.no-related-tools {
    text-align: center;
    padding: 2rem;
    color: var(--dark-text);
    opacity: 0.7;
    font-style: italic;
}

/* Light Mode Overrides for Template Sections */
.light-mode .faq-item {
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
}

.light-mode .faq-question {
    color: var(--light-text);
}

.light-mode .faq-answer {
    color: var(--light-text);
}

.light-mode .step-item {
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
}

.light-mode .step-content p {
    color: var(--light-text);
}

.light-mode .related-tool-card {
    background: var(--faq-item-bg);
    border: var(--faq-item-border);
}

.light-mode .related-tool-content h3 a {
    color: var(--light-text);
}

.light-mode .related-tool-content p {
    color: var(--light-text);
}

/* Responsive Design for Template Sections */
@media (max-width: 768px) {
    .section {
        padding: 3rem 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .faq-question {
        padding: 1.2rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .faq-answer {
        padding: 0 1.5rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 1.5rem 1.2rem;
    }
    
    .step-item {
        padding: 1.2rem 1.5rem;
        gap: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-content p {
        font-size: 1rem;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .related-tool-card {
        padding: 1.2rem;
    }
    
    .related-tool-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0.5rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .faq-question {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1.2rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 1.2rem 1rem;
    }
    
    .step-item {
        padding: 1rem 1.2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .related-tool-card {
        padding: 1rem;
    }
}

