:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --secondary-color: #9ca3af;
    --secondary-hover: #d1d5db;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --border-color: #374151;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

main{
    margin-top: 100px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Tool Header */
.tool-header {
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tool-icon {
    width: 64px;
    height: 64px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-info h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.tool-info p {
    margin: 0;
    color: var(--text-secondary);
}

/* Calculator Card */
.calculator-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-section {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

textarea#input-text {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

textarea#input-text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.key-input {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.key-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.key-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

select#encryption-algorithm {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
}

select#encryption-algorithm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-primary i, .btn-secondary i {
    font-size: 1.25rem;
}

/* Result Section */
.result-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.result-group {
    margin-bottom: 1.5rem;
}

.result-group:last-child {
    margin-bottom: 0;
}

.result-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.result-output {
    display: flex;
    gap: 0.5rem;
}

.result-output textarea {
    flex: 1;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.result-output textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.result-info {
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

/* Info Cards */
.info-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.info-card p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.info-card ul, .info-card ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.info-card li {
    margin-bottom: 0.5rem;
}

.info-card li:last-child {
    margin-bottom: 0;
}

.info-card strong {
    color: var(--text-primary);
}

/* Related Tools */
.related-tools {
    margin-bottom: 2rem;
}

.related-tools h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transition: transform 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
}

.tool-card .tool-icon {
    width: 48px;
    height: 48px;
    padding: 0.75rem;
}

.tool-card .tool-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.tool-card .tool-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .tool-info h1 {
        font-size: 1.75rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .info-card {
        padding: 1.5rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-info h1 {
        font-size: 1.5rem;
    }

    .calculator-card {
        padding: 1rem;
    }

    .info-card {
        padding: 1rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* --- DARK MODE: MATCH OTHER TOOLS --- */
body.dark-mode {
  background-color: #111827;
  color: #f9fafb;
}

body.dark-mode .background-light,
body.dark-mode .calculator-card,
body.dark-mode .info-card,
body.dark-mode #toggle-key,
body.dark-mode .result-section,
body.dark-mode #copy-result,
body.dark-mode .faq-item {
  background-color: #1f2937 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06) !important;
  border: 1px solid #374151 !important;
  margin-bottom: 2rem !important;
}

body.dark-mode .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem !important;
}

body.dark-mode main {
  margin-top: 100px !important;
  min-height: calc(100vh - 180px) !important;
}

body.dark-mode .card-section {
  border-radius: 0.75rem !important;
}

body.dark-mode .result-container,
body.dark-mode .additional-info {
  border-radius: 0.5rem !important;
  background-color: #374151 !important;
  border: 1px solid #374151 !important;
}

body.dark-mode .faq-item {
  border-color: #374151 !important;
}

body.dark-mode input,
body.dark-mode .tool-card,
body.dark-mode #encryption-algorithm,
body.dark-mode .result-info,
body.dark-mode textarea {
  background-color: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}

body.dark-mode .primary-button,
body.dark-mode .outline-button,
body.dark-mode .btn-primary {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: #3b82f6 !important;
}

body.dark-mode .primary-button:hover,
body.dark-mode .outline-button:hover,
body.dark-mode .btn-primary:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

body.dark-mode .label,
body.dark-mode label,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode .faq-answer {
  color: #d1d5db !important;
}
body.dark-mode .value,
body.dark-mode .detail-value {
  color: #a5b4fc !important;
} 