/* Payload Checksum Generator Styles */

.checksum-generator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Mode Selection */
.mode-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.mode-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Mode Panels */
.mode-panel {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mode-panel h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.2rem;
}

/* Input Controls */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.input-group textarea,
.input-group input[type="text"],
.input-group input[type="url"],
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
}

.input-group textarea:focus,
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-upload-area.dragover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-input {
    display: none;
}

.file-info {
    margin-top: 10px;
    font-weight: 500;
    color: #6c757d;
}

/* URL Options */
.url-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .url-options {
        grid-template-columns: 1fr;
    }
}

/* Algorithm Selection */
.algorithm-selection {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.algorithm-selection h3 {
    margin: 0 0 15px 0;
    color: #495057;
}

.algorithm-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.algorithm-controls button {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.algorithm-controls button:hover {
    background: #5a6268;
}

.algorithm-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.algorithm-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.algorithm-option:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.algorithm-option input[type="checkbox"] {
    margin: 0;
}

.algorithm-option label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    margin: 0;
    flex: 1;
}

.algo-name {
    font-weight: 600;
    color: #495057;
}

.algo-bits {
    font-size: 12px;
    color: #6c757d;
}

.recommended {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

/* Text Options */
.text-options {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.text-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-option input[type="checkbox"] {
    margin: 0;
}

.text-option label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

/* Salt Options */
.salt-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.salt-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.salt-toggle input[type="checkbox"] {
    margin: 0;
}

.salt-toggle label {
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.salt-options {
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.salt-options .input-group {
    margin-bottom: 15px;
}

.salt-options .input-group:last-of-type {
    margin-bottom: 10px;
}

.salt-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.salt-input-group input {
    flex: 1;
}

.salt-input-group .btn-small {
    white-space: nowrap;
}

.salt-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
}

.salt-info small {
    color: #1565c0;
    font-size: 12px;
}

.salt-indicator {
    background: #ffc107;
    color: #212529;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

/* Results Section */
.results-container {
    display: none;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.results-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.results-header h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.results-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
    flex-wrap: wrap;
}

.results-table {
    padding: 20px;
}

.results-table-header {
    display: grid;
    grid-template-columns: 1fr 2fr 100px 120px;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.results-table-row {
    display: grid;
    grid-template-columns: 1fr 2fr 100px 120px;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f8f9fa;
    align-items: center;
}

.results-table-row:last-child {
    border-bottom: none;
}

.results-table-row.error-row {
    background: #fff5f5;
    color: #dc3545;
}

.checksum-value code {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
    font-size: 12px;
}

.results-actions {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

/* Verification Section */
.verification-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.verification-section h3 {
    margin: 0 0 20px 0;
    color: #495057;
}

.verify-input {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.verify-results {
    display: none;
    margin-top: 20px;
}

.verification-summary {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.verification-summary.match {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.verification-summary.no-match {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.verification-summary h4 {
    margin: 0 0 10px 0;
}

.verification-summary p {
    margin: 5px 0;
}

.verification-details h5 {
    margin: 0 0 15px 0;
    color: #495057;
}

.verification-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.verification-row.match {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.verification-row.no-match {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.verification-algorithm {
    font-weight: 600;
    color: #495057;
}

.verification-comparison div {
    margin-bottom: 5px;
    font-size: 14px;
}

.verification-status {
    font-weight: 600;
}

/* History Section */
.history-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-section h3 {
    margin: 0 0 20px 0;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-type {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.history-date {
    font-size: 12px;
    color: #6c757d;
}

.history-description {
    font-weight: 500;
    margin-bottom: 5px;
    color: #495057;
}

.history-meta {
    font-size: 12px;
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Loading Spinner */
.checksum-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-message {
    color: #495057;
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-warning {
    background: #ffc107;
    color: #212529;
}

.notification-info {
    background: #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checksum-generator {
        padding: 10px;
    }
    
    .mode-selection {
        flex-direction: column;
    }
    
    .mode-btn {
        justify-content: center;
    }
    
    .algorithm-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .results-table-header,
    .results-table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .results-table-header {
        display: none;
    }
    
    .results-table-row {
        padding: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .verify-input {
        grid-template-columns: 1fr;
    }
    
    .verification-row {
        grid-template-columns: 1fr;
    }
    
    .results-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .checksum-generator {
        max-width: none;
        padding: 0;
    }
    
    .mode-selection,
    .algorithm-selection,
    .action-buttons,
    .verification-section,
    .history-section {
        display: none;
    }
    
    .results-container {
        display: block !important;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .checksum-loader,
    .notification {
        display: none !important;
    }
}