/* Additional styles for the Translate page */


/* Recognition status indicator */

.recognition-status {
    margin-top: 15px;
    text-align: center;
}

.status-indicator {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.status-indicator i {
    margin-right: 5px;
}

.status-indicator.active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-indicator.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}


/* Confidence indicator */

.confidence-indicator {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: #e9ecef;
    color: #495057;
}


/* Recent signs list */

.signs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.recent-sign {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
}

.recent-sign:hover {
    background-color: #e9ecef;
    transform: translateX(2px);
}

.sign-text {
    font-weight: 500;
    color: #343a40;
}

.sign-confidence {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.sign-confidence.high {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.sign-confidence.medium {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.sign-confidence.low {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}


/* Sentence actions */

.sentence-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #ced4da;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background-color: #e9ecef;
    color: #212529;
}

.btn-sm i {
    margin-right: 5px;
}

.btn-sm.success {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
    animation: pulse 1s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}


/* Subscription Plans Styling */

.subscription-plans {
    margin: 40px 0 20px;
    text-align: center;
}

.subscription-plans h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark-blue);
}

.plans-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.plan {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 25px;
    width: 280px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.plan h4 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.plan p {
    color: #4A5568;
    margin-bottom: 15px;
    font-size: 14px;
}

.plan ul {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}

.plan ul li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    font-size: 14px;
}

.plan ul li:before {
    content: '✓';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 8px;
}

.plan .btn {
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
}

.payment-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.payment-info h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-blue);
}

.payment-info p {
    margin-bottom: 5px;
    font-size: 14px;
}

.payment-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.payment-info a:hover {
    text-decoration: underline;
}

.translate-container {
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.translate-header {
    text-align: center;
    margin-bottom: 30px;
}

.translate-header h2 {
    font-size: 32px;
    color: var(--dark-blue);
    margin-bottom: 16px;
}

.translate-header p {
    font-size: 18px;
    color: #4A5568;
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.translate-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.translate-controls button,
.translate-controls select {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.translate-controls select {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233366FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.translate-controls select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.speaking {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(51, 102, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(51, 102, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(51, 102, 255, 0);
    }
}

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

.btn-primary:hover {
    background-color: #2851E0;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: #F0F4FF;
}

.btn-secondary:disabled,
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.translate-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-container {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    position: relative;
}

#videoFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--light-gray);
}

.camera-placeholder img {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.camera-placeholder p {
    font-size: 18px;
    color: #4A5568;
    margin-bottom: 0;
}

.translation-results {
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.current-sign,
.sentence-container,
.recent-signs,
.rsl-info {
    background-color: var(--light-gray);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.current-sign,
.sentence-container {
    grid-column: span 1;
}

.recent-signs,
.rsl-info {
    grid-column: span 2;
}

.current-sign h3,
.sentence-container h3,
.recent-signs h3,
.rsl-info h3 {
    font-size: 18px;
    color: var(--dark-blue);
    margin-bottom: 16px;
}

.sign-display {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    min-height: 50px;
    transition: transform 0.2s ease;
}

.sign-display.detected {
    transform: scale(1.1);
    color: #2851E0;
}

.sign-confidence {
    text-align: center;
    margin-top: 10px;
    font-size: 16px;
    color: #4A5568;
}

#signConfidence {
    font-weight: 600;
    color: var(--primary-color);
}

.sentence-display {
    font-size: 24px;
    color: var(--dark-blue);
    line-height: 1.5;
    min-height: 36px;
    margin-bottom: 10px;
}

.translated-display {
    font-size: 20px;
    color: #2851E0;
    font-style: italic;
    line-height: 1.5;
    min-height: 30px;
    border-top: 1px solid #E2E8F0;
    padding-top: 10px;
    margin-top: 10px;
}

.rsl-info p {
    font-size: 16px;
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 12px;
}

.signs-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.signs-list li {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}


/* Responsive styles */

@media (max-width: 768px) {
    .translate-controls {
        flex-wrap: wrap;
    }
    .video-container {
        height: 350px;
    }
    .translate-header h2 {
        font-size: 28px;
    }
    .translate-header p {
        font-size: 16px;
    }
    .translation-results {
        grid-template-columns: 1fr;
    }
    .current-sign,
    .sentence-container,
    .recent-signs,
    .rsl-info {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .translate-controls {
        flex-direction: column;
    }
    .video-container {
        height: 250px;
    }
    .sign-display {
        font-size: 28px;
    }
    .sentence-display {
        font-size: 20px;
    }
    .translated-display {
        font-size: 18px;
    }
    .rsl-info p {
        font-size: 14px;
    }
}


/* Enhanced Translate Page Styles */

.translate-container {
    padding: clamp(2rem, 5vw, 3rem) 0;
    max-width: min(1200px, 100%);
    margin: 0 auto;
}

.translate-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.translate-header h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
}

.translate-header p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    max-width: min(700px, 90%);
    margin: 0 auto 1.5rem;
}

.translate-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.translate-controls button,
.translate-controls select {
    padding: clamp(0.75rem, 3vw, 1rem) clamp(1rem, 4vw, 1.5rem);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    /* Minimum touch target size */
    min-width: 44px;
}


/* Video Container with aspect ratio */

.video-container {
    width: 100%;
    max-width: min(800px, 100%);
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 auto 2rem;
    position: relative;
    background-color: #000;
}

#videoFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--light-gray);
    color: var(--text-color);
    padding: 2rem;
    text-align: center;
}

.camera-placeholder img {
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    margin-bottom: 1rem;
}

.camera-placeholder p {
    font-size: clamp(1rem, 3vw, 1.25rem);
}


/* Translation Results Grid */

.translation-results {
    width: 100%;
    max-width: min(800px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.current-sign,
.sentence-container,
.recent-signs,
.rsl-info {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: clamp(1.25rem, 4vw, 1.75rem);
    box-shadow: var(--shadow);
}

.current-sign h3,
.sentence-container h3,
.recent-signs h3,
.rsl-info h3 {
    font-size: clamp(1.125rem, 3vw, 1.375rem);
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.sign-display {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    min-height: clamp(40px, 10vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sentence-display {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
    color: var(--text-color);
    line-height: 1.5;
    min-height: clamp(60px, 15vw, 90px);
    margin-bottom: 1rem;
}

.translated-display {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--primary-color);
    font-style: italic;
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}


/* Recent Signs */

.signs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.signs-list li {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 500;
}


/* Recognition Status */

.recognition-status {
    margin-top: 1rem;
    text-align: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}


/* Responsive Design */

@media (max-width: 768px) {
    .translate-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .translate-controls button,
    .translate-controls select {
        width: 100%;
    }
    .translation-results {
        grid-template-columns: 1fr;
    }
    .video-container {
        aspect-ratio: 4/3;
        /* Better for mobile */
    }
}

@media (max-width: 480px) {
    .translate-container {
        padding: 1.5rem 0;
    }
    .translate-header h2 {
        font-size: 1.5rem;
    }
    .translate-header p {
        font-size: 1rem;
    }
    .sign-display {
        font-size: 1.75rem;
    }
    .sentence-display {
        font-size: 1.125rem;
    }
    .translated-display {
        font-size: 1rem;
    }
    .signs-list li {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}


/* Landscape orientation support */

@media (max-height: 500px) and (orientation: landscape) {
    .translate-container {
        padding: 1rem 0;
    }
    .video-container {
        max-height: 60vh;
    }
    .translation-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}


/* Touch device improvements */

@media (hover: none) and (pointer: coarse) {
    .translate-controls button {
        min-height: 44px;
    }
    .signs-list li {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .sign-display {
        transition: none;
    }
}