/* HashCrack - Professional CSS Framework */

/* CSS Variables for Design System */
:root {
    /* Colors - Blue theme for HashCrack */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-900: #0c4a6e;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --success-500: #10b981;
    --warning-500: #f59e0b;
    --error-500: #ef4444;
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark mode variables */
.dark-mode {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    
    /* Adjust blue primary colors for dark mode */
    --primary-50: #082f49;
    --primary-100: #0c4a6e;
    --primary-500: #0ea5e9;
    --primary-600: #38bdf8;
    --primary-700: #7dd3fc;
    --primary-900: #e0f2fe;
    
    /* Adjust shadow for dark mode to be more visible */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    
    background-color: var(--gray-50);
    color: var(--gray-700);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
    transition: color var(--transition-base);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Platform Layout */
.platform {
    min-height: 100vh;
    padding-bottom: var(--space-md);
}

.platform-header {
    padding: var(--space-xs) var(--space-lg);
    background-color: var(--primary-500);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.platform-title {
    font-size: 1.5rem;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.platform-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: var(--space-xs);
}

.theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Container Layout */
.crack-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* Two-column Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Statistics Row */
.stats-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.stat-card {
    flex: 1;
    background-color: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-base);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-600);
    display: block;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    padding: var(--space-xs) 0;
}

.section-header h3 {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: 0;
}

/* Shared section styles */
.input-section,
.wordlist-section,
.progress-section,
.history-section {
    background-color: var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-base);
    margin-bottom: var(--space-sm);
}

/* Input Section */
.input-section {
    margin-bottom: var(--space-sm);
}

.input-group {
    margin-bottom: var(--space-sm);
}

.input-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--gray-800);
    font-size: 0.875rem;
}

/* Hash Input */
.hash-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background-color: white;
    transition: border-color var(--transition-fast), background-color var(--transition-base), color var(--transition-base);
}

.hash-input:focus {
    outline: none;
    border-color: var(--primary-500);
}

.hash-detection {
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Wordlist Section */
.wordlist-section {
    margin-bottom: var(--space-sm);
}

.wordlist-built-in,
.wordlist-upload {
    margin-bottom: var(--space-sm);
}

.wordlist-select {
    width: 100%;
    padding: var(--space-xs);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    transition: border-color var(--transition-fast), background-color var(--transition-base), color var(--transition-base);
}

.wordlist-help {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--gray-600);
}

.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-base), color var(--transition-base);
}

.file-upload-area:hover {
    border-color: var(--primary-500);
}

.upload-icon {
    font-size: 1.5rem;
    color: var(--gray-400);
    margin-bottom: var(--space-sm);
}

.upload-limit {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--gray-500);
}

.hidden-file-input {
    display: none;
}

/* Progress Section */
.progress-section {
    margin-bottom: var(--space-sm);
}

.progress-bar-container {
    height: 8px;
    background-color: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-500);
    width: 0;
    transition: width 0.3s ease;
}

.progress-status {
    font-size: 0.8rem;
    color: var(--gray-600);
    text-align: center;
}

/* Crack Button */
.crack-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm);
    background-color: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    margin-bottom: var(--space-sm);
}

.crack-button:hover {
    background-color: var(--primary-600);
}

/* History and Results Sections */
.history-section {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-200);
    max-height: 600px;
    overflow-y: auto;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-full);
    background-color: var(--primary-500);
    color: white;
    font-size: 0.75rem;
    margin-left: var(--space-xs);
}

.toggle-history {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--space-xs);
    transition: color var(--transition-fast);
}

.toggle-history:hover {
    color: var(--primary-600);
}

.toggle-history.active {
    color: var(--primary-600);
}

.history-content {
    transition: max-height var(--transition-base);
}

.hidden {
    display: none;
}

.no-history-message {
    text-align: center;
    padding: var(--space-md) 0;
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.history-table th,
.history-table td {
    padding: var(--space-xs) var(--space-sm);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.history-table th {
    font-weight: 600;
    color: var(--gray-800);
}

.history-table td {
    color: var(--gray-700);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-hash {
    font-family: var(--font-mono);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.found {
    color: var(--success-500);
    font-weight: 600;
}

.not-found {
    color: var(--error-500);
    font-weight: 600;
    font-style: italic;
}

.history-actions {
    display: flex;
    gap: var(--space-xs);
    white-space: nowrap;
}

.history-button {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.history-button:hover {
    color: var(--primary-600);
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.action-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background-color: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.action-button:hover {
    background-color: var(--primary-600);
}

.action-button:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.7;
}

.action-button.secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.action-button.secondary:hover {
    background-color: var(--gray-300);
}

/* Notifications */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.notification {
    background-color: var(--gray-100);
    border-left: 4px solid var(--primary-500);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    max-width: 350px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    animation-fill-mode: forwards;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.notification-icon {
    font-size: 1.25rem;
    color: var(--primary-500);
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
}

.notification.success {
    border-left-color: var(--success-500);
}

.notification.success .notification-icon {
    color: var(--success-500);
}

.notification.warning {
    border-left-color: var(--warning-500);
}

.notification.warning .notification-icon {
    color: var(--warning-500);
}

.notification.error {
    border-left-color: var(--error-500);
}

.notification.error .notification-icon {
    color: var(--error-500);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Dark Mode Specific Styles */
.dark-mode .hash-input,
.dark-mode .text-input,
.dark-mode .wordlist-select {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-800);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-mode .hash-input:focus,
.dark-mode .text-input:focus,
.dark-mode .wordlist-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.dark-mode .file-upload-area {
    border-color: var(--gray-400);
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.dark-mode .stat-card {
    background-color: var(--gray-100);
}

.dark-mode .action-button {
    background-color: var(--primary-600);
    color: white;
}

.dark-mode .action-button:hover {
    background-color: var(--primary-700);
}

.dark-mode .action-button.secondary {
    background-color: var(--gray-300);
    color: var(--gray-900);
}

.dark-mode .action-button.secondary:hover {
    background-color: var(--gray-400);
}

.dark-mode .notification {
    background-color: var(--gray-100);
    border-left-color: var(--primary-500);
}

.dark-mode .history-table th {
    color: var(--gray-600);
    border-bottom-color: var(--gray-300);
    background-color: var(--gray-200);
}

.dark-mode .history-table td {
    color: var(--gray-600);
    border-bottom-color: var(--gray-300);
}

/* Add more contrast to table rows in dark mode */
.dark-mode .history-table tr:hover {
    background-color: var(--gray-200);
}

.dark-mode .history-hash {
    color: var(--gray-600);
}

.dark-mode .found {
    color: var(--success-500);
}

.dark-mode .not-found {
    color: var(--error-500);
}

/* Dark mode section styles */
.dark-mode .input-section,
.dark-mode .wordlist-section,
.dark-mode .progress-section,
.dark-mode .history-section {
    background-color: var(--gray-100); /* This will use the dark mode gray-100 variable */
    border: 1px solid var(--gray-200);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .crack-container {
        padding: 0 var(--space-md);
    }
    
    .stats-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .actions-row {
        flex-direction: column;
    }
    
    .history-table th:nth-child(3),
    .history-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .platform-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .header-right {
        align-self: flex-end;
    }
}
