/**
 * ConvMaster - Days 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);
}

.tool-header__icon .icon--cyan {
    background: rgba(6, 182, 212, 0.15);
}

.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);
}

/* =====================================================
   CURRENT DATE BANNER
   ===================================================== */
.current-date-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.current-date-banner__icon {
    font-size: 1.25rem;
}

.current-date-banner__text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* =====================================================
   MODE TABS
   ===================================================== */
.days-calc-widget__tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.calc-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.calc-tab:hover {
    color: var(--text-primary);
    background: rgba(6, 182, 212, 0.05);
}

.calc-tab--active {
    color: #06b6d4;
    background: var(--bg-card);
}

.calc-tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #06b6d4;
}

.calc-tab__icon {
    font-size: 1.1rem;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.days-calc-widget__content {
    padding: 1.5rem;
}

/* =====================================================
   DATE INPUTS
   ===================================================== */
.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.date-inputs--single {
    grid-template-columns: 1fr 200px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-field__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-field__header label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-today {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-today:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
}

.date-input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.date-input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Calendar icon for Chrome/Webkit - Dark mode (default) */
.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Calendar icon - Light mode */
[data-theme="light"] .date-input::-webkit-calendar-picker-indicator {
    filter: none;
}

.date-weekday {
    font-size: 0.85rem;
    color: #06b6d4;
    font-weight: 500;
    min-height: 1.25rem;
}

/* Days Input */
.days-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.days-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.days-input {
    padding: 0.875rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s ease;
}

.days-input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* =====================================================
   QUICK BUTTONS
   ===================================================== */
.quick-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.quick-buttons__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.quick-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.5);
    background: rgba(6, 182, 212, 0.1);
}

/* =====================================================
   OPTIONS PANEL
   ===================================================== */
.calc-options {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.calc-options__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.calc-options__header:hover {
    background: rgba(6, 182, 212, 0.05);
}

.calc-options__toggle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.calc-options[open] .calc-options__toggle {
    transform: rotate(180deg);
}

.calc-options__content {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Option Checkbox */
.calc-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.calc-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calc-option__check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
}

.calc-option input:checked + .calc-option__check {
    border-color: #06b6d4;
    background: #06b6d4;
}

.calc-option input:checked + .calc-option__check::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    color: white;
    font-weight: bold;
}

.calc-option__label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.calc-option:hover .calc-option__check {
    border-color: #06b6d4;
}

.calc-option--highlight .calc-option__label {
    color: #06b6d4;
    font-weight: 500;
}

/* Exclude Days */
.exclude-days {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exclude-days__label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exclude-days__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-checkbox {
    cursor: pointer;
}

.day-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.day-checkbox__box {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.day-checkbox:hover .day-checkbox__box {
    border-color: rgba(6, 182, 212, 0.5);
}

.day-checkbox input:checked + .day-checkbox__box {
    color: white;
    background: #06b6d4;
    border-color: #06b6d4;
}

/* =====================================================
   CALCULATE BUTTON
   ===================================================== */
.btn-calculate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate__icon {
    font-size: 1.1rem;
}

/* =====================================================
   RESULT SECTION
   ===================================================== */
.calc-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.3s ease;
}

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

.calc-result__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.calc-result__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.5);
}

.btn-copy__icon {
    font-size: 0.9rem;
}

/* Main Result */
.result-main {
    text-align: center;
    margin-bottom: 1.25rem;
}

.result-big {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.result-big__number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #06b6d4;
    line-height: 1;
}

.result-big__label {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Result Detail */
.result-detail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-row__icon {
    font-size: 1.1rem;
}

.result-row__text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Visual Summary */
.result-visual {
    margin-bottom: 1rem;
}

.result-visual__bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
    margin-bottom: 0.75rem;
}

.result-visual__counted {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
    transition: width 0.5s ease;
}

.result-visual__excluded {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    transition: width 0.5s ease;
}

.result-visual__legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-item--counted .legend-dot {
    background: #06b6d4;
}

.legend-item--excluded .legend-dot {
    background: #f43f5e;
}

/* Date Result (for add/subtract) */
.result-date {
    margin-top: 1rem;
}

.result-date__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-md);
}

.result-date__label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-date__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-date__weekday {
    font-size: 1rem;
    font-weight: 500;
    color: #06b6d4;
}

/* Copy Message */
.copy-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

/* =====================================================
   INFO NOTICE
   ===================================================== */
.calc-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.calc-info p {
    margin: 0;
}

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

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

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

.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);
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

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

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

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

/* 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);
    text-align: center;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

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

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

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

.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-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.faq-item[open] summary::after {
    content: '−';
}

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

/* =====================================================
   HIDDEN UTILITY
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .tool-page {
        padding: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-header__text h1 {
        font-size: 1.5rem;
    }
    
    .current-date-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .calc-tab__name {
        display: none;
    }
    
    .calc-tab {
        padding: 1rem;
    }
    
    .calc-tab__icon {
        font-size: 1.5rem;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
    }
    
    .date-inputs--single {
        grid-template-columns: 1fr;
    }
    
    .quick-buttons {
        justify-content: center;
    }
    
    .exclude-days__grid {
        justify-content: center;
    }
    
    .result-big__number {
        font-size: 2.5rem;
    }
    
    .result-visual__legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .days-calc-widget__content {
        padding: 1rem;
    }
    
    .calc-options__content {
        padding: 0 1rem 1rem;
    }
    
    .day-checkbox__box {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }
    
    .result-date__value {
        font-size: 1.25rem;
    }
    
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   DARK/LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .current-date-banner {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(59, 130, 246, 0.08));
}

[data-theme="light"] .result-date__card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(59, 130, 246, 0.08));
}

[data-theme="light"] .date-input,
[data-theme="light"] .days-input {
    background: white;
}
