/**
 * ConvMaster - Rule of Three Calculator Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    font-weight: 700;
}

.tool-header__icon .icon--rule-of-three {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    font-size: 2rem;
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   FORMAT BADGES
   ===================================================== */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.format-badge--cross {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.format-badge--proportion {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.format-badge--instant {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

/* =====================================================
   CALCULATOR WIDGET
   ===================================================== */
.rot-calculator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Top Bar */
.rot-calculator__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rot-calculator__date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rot-calculator__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rot-calculator__design {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rot-calculator__design select {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Workspace */
.rot-calculator__workspace {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
}

.rot-calculator__main {
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.rot-calculator__history {
    padding: 1rem;
    background: var(--bg-secondary);
}

/* =====================================================
   MODE TABS
   ===================================================== */
.rot-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.rot-tab {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.rot-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.rot-tab--active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   MODE CONTENT
   ===================================================== */
.rot-mode {
    display: block;
}

.rot-mode[hidden] {
    display: none;
}

.rot-mode__desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* =====================================================
   DIRECT MODE - PROPORTION DISPLAY
   ===================================================== */
.rot-proportion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.rot-proportion__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rot-proportion__divider {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    font-weight: 300;
    width: 100%;
    text-align: center;
}

.rot-proportion__equals {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-tertiary);
}

/* =====================================================
   INPUT GROUPS
   ===================================================== */
.rot-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rot-input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.rot-input-group--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.rot-input-group--inline label {
    text-align: left;
}

.rot-input {
    width: 120px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-appearance: textfield;
}

.rot-input::-webkit-outer-spin-button,
.rot-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rot-input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.rot-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.rot-input--result {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.rot-unknown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* =====================================================
   FORMULA DISPLAY
   ===================================================== */
.rot-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.rot-formula__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rot-formula code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.rot-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

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

.btn--outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn--outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn--ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn--ghost:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.btn--small {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* =====================================================
   UNKNOWN SELECTOR
   ===================================================== */
.rot-unknown-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.rot-unknown-selector__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rot-unknown-selector__buttons {
    display: flex;
    gap: 0.5rem;
}

.rot-unknown-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rot-unknown-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* =====================================================
   INVERSE MODE
   ===================================================== */
.rot-inverse {
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

.rot-inverse__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.rot-inverse__arrow {
    font-size: 1.25rem;
    color: var(--text-tertiary);
}

.rot-inverse__separator {
    text-align: center;
    padding: 1rem 0;
}

.rot-inverse__separator span {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* =====================================================
   PERCENTAGE MODE
   ===================================================== */
.rot-percentage {
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.rot-percentage__row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rot-percentage__operator {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-tertiary);
    padding-bottom: 0.75rem;
}

.rot-input-wrapper {
    position: relative;
    display: inline-flex;
}

.rot-input-wrapper .rot-input {
    padding-right: 2rem;
}

.rot-input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* =====================================================
   MESSAGE AREA
   ===================================================== */
.rot-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.rot-message[hidden] {
    display: none;
}

.rot-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.rot-message--success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* =====================================================
   PRIVACY NOTICE
   ===================================================== */
.rot-privacy {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.rot-privacy p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* =====================================================
   HISTORY PANEL
   ===================================================== */
.rot-history {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rot-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.rot-history__header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rot-history__list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.rot-history__empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    padding: 2rem 1rem;
}

.rot-history__item {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.rot-history__item-calc {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.rot-history__item-result {
    color: var(--primary);
    font-weight: 600;
}

.rot-history__item-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* =====================================================
   EXAMPLES SECTION
   ===================================================== */
.rot-examples {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.rot-examples h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
    text-align: center;
}

.rot-examples__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.rot-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rot-example:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rot-example__icon {
    font-size: 1.5rem;
}

.rot-example__text {
    font-size: 0.75rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
}

.rot-example__values {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-section > p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.feature-card__icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    position: relative;
}

.step-card__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =====================================================
   DESIGN VARIANTS
   ===================================================== */

/* Modern Design */
.rot-calculator[data-design="modern"] .rot-input {
    border-radius: 0;
    border-width: 0 0 3px 0;
    background: transparent;
}

.rot-calculator[data-design="modern"] .rot-input:focus {
    box-shadow: none;
}

.rot-calculator[data-design="modern"] .btn {
    border-radius: 0;
}

.rot-calculator[data-design="modern"] .rot-tabs {
    background: transparent;
    border-bottom: 2px solid var(--border-color);
    border-radius: 0;
    padding: 0;
}

.rot-calculator[data-design="modern"] .rot-tab {
    border-radius: 0;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.rot-calculator[data-design="modern"] .rot-tab--active {
    border-bottom-color: var(--primary);
    box-shadow: none;
}

/* Minimal Design */
.rot-calculator[data-design="minimal"] {
    background: transparent;
    border: none;
    box-shadow: none;
}

.rot-calculator[data-design="minimal"] .rot-calculator__topbar {
    background: transparent;
    border: none;
    padding: 0 0 1rem;
}

.rot-calculator[data-design="minimal"] .rot-calculator__main {
    border: none;
    padding: 0;
}

.rot-calculator[data-design="minimal"] .rot-calculator__history {
    background: transparent;
}

.rot-calculator[data-design="minimal"] .rot-tabs {
    background: transparent;
    padding: 0;
}

.rot-calculator[data-design="minimal"] .rot-tab {
    background: transparent;
}

.rot-calculator[data-design="minimal"] .rot-formula,
.rot-calculator[data-design="minimal"] .rot-privacy,
.rot-calculator[data-design="minimal"] .rot-unknown-selector {
    background: transparent;
    border: 1px solid var(--border-color);
}

.rot-calculator[data-design="minimal"] .rot-examples {
    background: transparent;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
    .rot-calculator__workspace {
        grid-template-columns: 1fr;
    }
    
    .rot-calculator__main {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .rot-calculator__history {
        max-height: 250px;
    }
    
    .rot-history__list {
        max-height: 180px;
    }
}

@media (max-width: 700px) {
    .tool-page {
        padding: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .rot-calculator__topbar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .rot-proportion {
        flex-direction: column;
        gap: 1rem;
    }
    
    .rot-proportion__equals {
        transform: rotate(90deg);
    }
    
    .rot-examples__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rot-percentage__row {
        flex-direction: column;
        align-items: center;
    }
    
    .rot-percentage__operator {
        padding: 0.5rem 0;
    }
    
    .rot-inverse__row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rot-inverse__arrow {
        transform: rotate(90deg);
    }
    
    .rot-input {
        width: 100%;
        max-width: 150px;
    }
}

@media (max-width: 500px) {
    .rot-tabs {
        flex-direction: column;
    }
    
    .rot-unknown-selector {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .rot-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .rot-examples__grid {
        grid-template-columns: 1fr;
    }
}
