@font-face {
    font-family: system;
    font-style: normal;
    font-weight: 300;
    src: local(".SFNSText-Light"), local(".HelveticaNeueDeskInterface-Light"), local(".LucidaGrandeUI"), local("Ubuntu Light"), local("Segoe UI Light"), local("Roboto-Light"), local("DroidSans"), local("Tahoma");
}

* {
    box-sizing: border-box;
}

body {
    font-family: "system", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
}

/* This font will be blocked by CSP */
@font-face {
    font-family: 'Special Gothic';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/specialgothic/v3/1q2SY5WcG0Fg_v0fHc8BvIZ2537qdm1JEt9N3w2mJykkHloQbL1fjQ.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.logo {
    width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.emojicon {
    text-align: center;
    font-size: 4rem;
    margin: 20px 0;
}

.headline {
    text-align: center;
    font-size: 2.5rem;
    margin: 0 0 30px 0;
    color: #2c3e50;
    font-weight: 600;
}

/* Forms */
form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

label {
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
    color: #495057;
}

input[type="text"], input[type="email"], textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    margin-top: 5px;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

button:active {
    transform: translateY(0);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
    transition: background-color 0.3s ease;
}

/* Code blocks */
code {
    background: #f1f3f4;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #d73a49;
    border: 1px solid #e1e4e8;
}

pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

pre code {
    background: transparent;
    color: #e2e8f0;
    border: none;
    padding: 0;
}

/* Lists */
ul, ol {
    margin: 15px 0;
    padding-left: 25px;
}

li {
    margin-bottom: 8px;
}

/* Paragraphs */
p {
    margin: 15px 0;
    color: #495057;
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Status messages */
.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

/* Security demo specific styles */
.attack-examples {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f1c40f;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.attack-examples h3 {
    color: #856404;
    margin-top: 0;
}

/* Overlay for clickjacking demos */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 9999;
}

/* iframe for clickjacking demos */
.jackframe {
    border: 0;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
}

/* TOC Navigation */
.toc-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #007acc;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

.toc-nav:hover {
    background: #005c99;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.4);
}

.attack-url {
    background: #f8f9fa;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    word-break: break-all;
    color: #dc3545;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f1c40f;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.attack-demo {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.attack-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 10px 5px;
    text-decoration: none;
    display: inline-block;
}

.attack-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
}

/* Compact TOC Styles */
.toc-compact {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    font-size: 14px;
}

.toc-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #2c3e50;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.category {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 3px;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.link:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.link-title {
    font-weight: 500;
    color: #3498db;
}

.link-desc {
    color: #666;
    font-size: 11px;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-icon {
    font-size: 12px;
    width: 16px;
    text-align: center;
    border: none;
    box-sizing: content-box;
}

.status-icon.vulnerable {
    color: #dc3545;
}

.status-icon.safe {
    color: #28a745;
}

.status-icon.neutral {
    color: #6c757d;
}

.footer {
    text-align: center;
    padding: 15px;
    background: rgba(255, 243, 205, 0.8);
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    font-size: 12px;
    color: #856404;
}

.timing-result {
    font-family: monospace;
    background: #f4f4f4;
    padding: 10px;
    margin: 10px 0;
    border-left: 4px solid #007bff;
}

.timing-result.correct {
    border-left-color: #28a745;
    background: #d4edda;
}

.timing-result.incorrect {
    border-left-color: #dc3545;
    background: #f8d7da;
}

#password {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.test-links form {
    margin: 10px 0;
}

/* Hostname input styling */
.hostname-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
}

.hostname-input-container label {
    margin: 0;
    flex-shrink: 0;
}

.hostname-input {
    width: 150px !important;
    margin: 0 !important;
}

.hostname-suffix {
    color: #495057;
    font-weight: 500;
    font-family: monospace;
}

/* Validation demo styles */
div.vulnerable {
    background: #fff5f5;
    border: 2px solid #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    color: #333;
}

div.safe {
    background: #f4fef7;
    border: 2px solid #51cf66;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    color: #333;
}

.info {
    color: #333;
}

.info h4 {
    color: #2c3e50;
    margin-top: 15px;
    margin-bottom: 10px;
}

.info code {
    word-break: break-all;
    white-space: pre-wrap;
}

.validation-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    background: #fff5f5;
}

.sanitization-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid #4dabf7;
    border-radius: 8px;
    background: #f0f7ff;
}

.escaping-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid #51cf66;
    border-radius: 8px;
    background: #f4fef7;
}

.summary-section {
    padding: 20px;
    border: 2px solid #9775fa;
    border-radius: 8px;
    background: #f8f5ff;
}

.summary-section table {
    margin: 20px 0;
}

.summary-section thead tr {
    background: #e5dbff;
}

.summary-section th {
    padding: 10px;
    text-align: left;
    background: #e5dbff;
    color: #333;
}

.summary-section td {
    padding: 10px;
}

.summary-section tbody tr {
    border-bottom: 1px solid #ddd;
}

.result-table {
    margin: 15px 0;
}

.result-table td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
}

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

.input-full-width {
    width: 100%;
}

.key-principle {
    margin-top: 20px;
}

.fetched-image {
    max-width: 100%;
    height: auto;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1, .headline {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px;
    }

    .toc-nav {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .toc-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .link-desc {
        display: none;
    }
}
