/* PhishGuard - Cybersecurity-themed CSS */

:root {
    /* Color Palette - Cybersecurity Theme */
    --primary-color: #00d4ff;
    --secondary-color: #0099cc;
    --danger-color: #ff3860;
    --warning-color: #ffdd57;
    --success-color: #23d160;
    --dark-bg: #0a0e1a;
    --darker-bg: #060810;
    --card-bg: #1a1f2e;
    --border-color: #2a3441;
    --text-primary: #ffffff;
    --text-secondary: #a0a9c1;
    --text-muted: #6b7280;
    
    /* Risk Level Colors */
    --risk-low: #23d160;
    --risk-medium: #ffdd57;
    --risk-high: #ff3860;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --danger-gradient: linear-gradient(135deg, #ff3860 0%, #ff1744 100%);
    --card-gradient: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --glow-primary: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-danger: 0 0 20px rgba(255, 56, 96, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 153, 204, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Section Styles */
section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Form Styles */
.analysis-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-type-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-type-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.input-type-selector select {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.input-type-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input-container {
    position: relative;
}

.input-label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#userInput {
    width: 100%;
    background: var(--darker-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', monospace;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition-fast);
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

#userInput::placeholder {
    color: var(--text-muted);
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Button Styles */
.analyze-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--glow-primary);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.risk-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.risk-score-container {
    text-align: center;
}

.risk-score {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.score-max {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
}

.risk-level {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.risk-level.low {
    background: rgba(35, 209, 96, 0.2);
    color: var(--risk-low);
    border: 1px solid var(--risk-low);
}

.risk-level.medium {
    background: rgba(255, 221, 87, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.risk-level.high {
    background: rgba(255, 56, 96, 0.2);
    color: var(--risk-high);
    border: 1px solid var(--risk-high);
}

.risk-bar {
    width: 100%;
    height: 20px;
    background: var(--darker-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.risk-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease, background-color 0.5s ease;
}

.risk-bar-fill.low {
    background: var(--risk-low);
}

.risk-bar-fill.medium {
    background: var(--warning-color);
}

.risk-bar-fill.high {
    background: var(--risk-high);
}

.analysis-summary {
    background: var(--darker-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 24px;
}

.analysis-summary p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Triggered Rules */
.triggered-rules h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rules-list li {
    background: var(--darker-bg);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rules-list li::before {
    content: "⚠️";
    font-size: 16px;
    flex-shrink: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.export-select {
    background: var(--card-gradient);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 180px;
    transition: var(--transition-fast);
}

.export-select:hover {
    background: var(--darker-bg);
    border-color: var(--primary-color);
}

.export-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.new-analysis-btn {
    background: var(--card-gradient);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.new-analysis-btn:hover {
    background: var(--darker-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* History Section */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.clear-history-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.clear-history-btn:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

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

.history-item {
    background: var(--darker-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.history-item:hover {
    background: var(--border-color);
}

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

.history-item-type {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.history-item-score {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.history-item-score.low {
    background: rgba(35, 209, 96, 0.2);
    color: var(--risk-low);
}

.history-item-score.medium {
    background: rgba(255, 221, 87, 0.2);
    color: var(--warning-color);
}

.history-item-score.high {
    background: rgba(255, 56, 96, 0.2);
    color: var(--risk-high);
}

.history-item-content {
    color: var(--text-secondary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-history {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.close-modal:hover {
    background: var(--darker-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.modal-body h4 {
    color: var(--primary-color);
    margin: 20px 0 10px 0;
}

.modal-body p, .modal-body li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.modal-body ul {
    margin-left: 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .risk-summary {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .risk-score {
        font-size: 2.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 15px;
    }
    
    .input-type-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
