/* HMAC specific styles - extends caesar.css base styling */

/* HMAC-specific input support - ensure Secret Key input matches select styling */
textarea, input[type="text"], select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--light-color);
    transition: border 0.3s, box-shadow 0.3s, background-color 0.3s;
}

textarea:focus, input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: var(--glow-effect);
}

/* Rotating gear effect for process button */
#process-btn .btn-icon .fa-cog {
    transition: transform 0.8s ease-in-out;
}

#process-btn:hover .btn-icon .fa-cog {
    transform: rotate(360deg);
}

/* HMAC Visualization Styles */
.shift-visualization {
    overflow-x: auto;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.visualization-guide {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Step Progress Indicator - Simplified Working Version */
.current-step-indicator {
    background-color: var(--input-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.progress-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

.progress-dot.completed {
    background-color: #4caf50;
    border-color: #4caf50;
    color: white;
}

.progress-line {
    width: 60px;
    height: 3px;
    background-color: var(--border-color);
    transition: all 0.3s ease;
}

.progress-line.active {
    background-color: #4caf50;
}

.step-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.step-label.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Hash Steps - Simplified Working Version */
.hash-step {
    background-color: var(--input-bg);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    border: 2px solid var(--border-color);
    transition: all 0.4s ease;
    opacity: 1;
}

.hash-step.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.step-number {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
}

.step-header h4 {
    color: var(--light-color);
    margin: 0;
    flex: 1;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Step Status - Simplified Working Version */
.step-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.step-status.processing {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
    color: #ffc107;
    animation: pulse 1.5s infinite;
}

.step-status.complete {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    color: #4caf50;
}

/* Step Content */
.step-content {
    margin-top: 1.5rem;
}

.step-explanation {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-explanation p {
    margin: 0;
    color: var(--light-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Process Visuals - Simplified Working Version */
.process-visual {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.input-display, .output-display {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.input-display:hover, .output-display:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.process-box {
    background-color: rgba(255, 193, 7, 0.1);
    border: 2px dashed rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.process-box:hover {
    background-color: rgba(255, 193, 7, 0.15);
    border-style: solid;
}

.arrow-down {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 1rem 0;
    font-weight: bold;
    transition: all 0.3s ease;
}

.arrow-down:hover {
    transform: translateY(-3px) scale(1.1);
    color: var(--accent-color);
}

/* XOR Operations - Simplified Working Version */
.xor-operation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.operand, .result {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--light-color);
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.operand:hover, .result:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.xor-symbol, .equals {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.xor-symbol:hover, .equals:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

.result.animate-highlight {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    animation: highlightPulse 0.8s ease;
}

.xor-result {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.2), rgba(var(--accent-color-rgb), 0.2));
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
    border-radius: 6px;
    padding: 0.8rem;
    font-family: 'Poppins', sans-serif;
    color: var(--light-color);
    transition: all 0.3s ease;
}

.xor-result:hover {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* Concatenation */
.concatenation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.concat-part {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--light-color);
}

.concat-symbol {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Hash Function Display - Simplified Working Version */
.hash-box {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.hash-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hash-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hash-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hash-spinner.spinning {
    opacity: 1;
    animation: spin 1s linear infinite;
}

.hash-text {
    font-family: var(--font-family);
    color: var(--light-color);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Hash Output */
.hash-output {
    background-color: rgba(76, 175, 80, 0.05);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.success-text {
    color: #4caf50;
    font-weight: 500;
}

/* Final Result - Simplified Working Version */
.final-result {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.2));
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.final-result:hover {
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.2);
}

.final-result .result-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 1rem;
}

.final-result .result-value {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 1rem;
    color: var(--light-color);
}

.final-result .formula {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 6px;
    margin: 1rem 0;
    color: var(--light-color);
    word-break: break-all;
}

.final-celebration {
    animation: celebrationPulse 2s ease-in-out;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-family);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #666, #555);
}

.nav-btn i {
    transition: transform 0.3s ease;
}

.nav-btn:hover:not(:disabled) i {
    transform: scale(1.1);
}

.current-step-info {
    color: var(--light-color);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    flex: 1;
    font-family: var(--font-family);
}

/* Clickable Progress Indicators */
.progress-dot.clickable,
.step-label.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.progress-dot.clickable:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.6);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.step-label.clickable:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.4);
    transform: translateY(-1px);
}

/* Only allow clicking on completed steps */
.progress-dot.completed.clickable,
.progress-dot.active.clickable {
    cursor: pointer;
}

.progress-dot:not(.completed):not(.active).clickable {
    cursor: not-allowed;
    opacity: 0.6;
}

.progress-dot:not(.completed):not(.active).clickable:hover {
    transform: none;
    box-shadow: none;
}

.step-label:not(.active).clickable {
    opacity: 0.7;
}

.step-label.active.clickable,
.step-label.completed.clickable {
    opacity: 1;
}

.step-label.completed {
    color: var(--light-color);
    opacity: 0.8;
}

.step-label.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Visualization Text Consistency */
.hash-step .step-explanation p,
.process-text,
.process-label,
.output-label,
.input-label,
.hash-label,
.result-header,
.completion-content p,
.completion-content li {
    font-family: var(--font-family);
    color: var(--light-color);
    line-height: 1.6;
}

.hash-step h4,
.completion-content h4 {
    font-family: var(--font-family);
    color: var(--primary-color);
    font-weight: 700;
}

.process-value,
.output-value,
.input-value,
.result-value {
    font-family: 'Poppins', sans-serif;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    word-break: break-all;
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-status {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    display: inline-block;
}

.step-status.processing {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.step-status.complete {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Completion Message */
.completion-message {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.25));
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.completion-message.show {
    opacity: 1;
    transform: translateY(0);
}

.completion-content h4 {
    color: #4caf50;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    font-family: var(--font-family);
}

.completion-content p {
    color: var(--light-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-family: var(--font-family);
}

.completion-content ul {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
}

.completion-content li {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-left: 4px solid #4caf50;
    color: var(--light-color);
    line-height: 1.5;
    font-family: var(--font-family);
}

.completion-content li strong {
    color: var(--primary-color);
}

/* Step Elements - Simplified Working Version */
.transformation-box,
.padding-creation,
.hash-computation {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.transformation-box:hover,
.padding-creation:hover,
.hash-computation:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.transform-input,
.transform-output,
.transform-process {
    text-align: center;
    margin: 1rem 0;
}

.transform-label,
.padding-label,
.operand-label {
    font-family: var(--font-family);
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.transform-value,
.padding-value {
    font-family: 'Poppins', sans-serif;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    border-radius: 6px;
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-break: break-all;
    transition: all 0.3s ease;
}

.transform-value:hover,
.padding-value:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

.transform-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.transform-arrow:hover {
    transform: translateY(-3px) scale(1.1);
    color: var(--accent-color);
}

/* Concatenation - Simplified Working Version */
.concatenation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.concat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.concat-item:hover {
    transform: translateY(-3px);
}

.concat-label {
    font-family: var(--font-family);
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.concat-part {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.concat-part:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.concat-symbol {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.concat-symbol:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* XOR Item styling */
.xor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.xor-item:hover {
    transform: translateY(-2px);
}

/* Input/Output Labels and Values */
.input-label, .output-label {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-value, .output-value {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--light-color);
    word-break: break-all;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.input-value:hover, .output-value:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

.process-text {
    color: #ffc107;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Additional Enhanced Styling - Simplified */
.hmac-summary {
    font-family: var(--font-family);
    color: var(--light-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}
@media (max-width: 768px) {
    .step-labels {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .progress-dot {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .step-label {
        writing-mode: horizontal-tb;
        max-width: 60px;
        line-height: 1.2;
    }
}

/* Essential Animations Only */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes highlightPulse {
    0% { 
        box-shadow: 0 0 0 rgba(255, 0, 0, 0.3);
        background-color: rgba(255, 0, 0, 0.05);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
        background-color: rgba(255, 0, 0, 0.15);
    }
    100% { 
        box-shadow: 0 0 0 rgba(255, 0, 0, 0.3);
        background-color: rgba(255, 0, 0, 0.05);
    }
}

@keyframes celebrationPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
    }
    25% { 
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    }
    75% { 
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
    }
}

/* Input group specific styles for HMAC */
.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

#verify-hmac-section {
    margin-top: 1rem;
}

/* Button specific styles */
.btn .btn-icon {
    margin-left: 0.5rem;
}

/* Copy button styling */
.copy-btn {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile responsiveness - HMAC specific */
@media (max-width: 768px) {
    .hash-step {
        padding: 1.5rem;
    }
    
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .step-progress {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .progress-line {
        width: 3px;
        height: 30px;
    }
    
    .step-labels {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .xor-operation, .concatenation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .process-visual {
        padding: 1rem;
    }
}