/**
 * Case Converter Tool - Styles
 * Lightweight, accessible, and responsive styling
 */

/* Reset and base styles */
.cct-wrapper {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
    background-color: #ffffff;
    padding: 20px;
    max-width: 100%;
}

.cct-wrapper *,
.cct-wrapper *::before,
.cct-wrapper *::after {
    box-sizing: inherit;
}

.cct-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Screen reader only text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Textarea styles */
.cct-textarea-wrapper {
    margin-bottom: 20px;
}

.cct-textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.6;
    color: #333333;
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cct-textarea:focus {
    outline: none;
    border-color: #484574;
    box-shadow: 0 0 0 3px rgba(72, 69, 116, 0.15);
}

.cct-textarea::placeholder {
    color: #999999;
}

/* Button row */
.cct-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Button styles */
.cct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #ffffff;
    background-color: #484574;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.cct-btn:hover {
    background-color: #5a5690;
    box-shadow: 0 2px 8px rgba(72, 69, 116, 0.3);
}

.cct-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(72, 69, 116, 0.4);
}

.cct-btn:focus-visible {
    outline: 2px solid #484574;
    outline-offset: 2px;
}

.cct-btn:active,
.cct-btn.cct-btn-active {
    background-color: #F46310;
    transform: scale(0.98);
}

.cct-btn:active:hover,
.cct-btn.cct-btn-active:hover {
    background-color: #ff7928;
}

/* Statistics row */
.cct-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #555555;
}

.cct-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cct-stat strong {
    color: #484574;
    font-weight: 600;
}

.cct-stat-divider {
    color: #cccccc;
    margin: 0 4px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cct-wrapper {
        padding: 15px;
    }

    .cct-textarea {
        min-height: 150px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .cct-button-row {
        gap: 8px;
    }

    .cct-btn {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }

    .cct-stats-row {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .cct-stat-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .cct-button-row {
        gap: 6px;
    }
    .cct-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cct-textarea {
        border-width: 3px;
    }

    .cct-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .cct-btn,
    .cct-textarea {
        transition: none;
    }
}