* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

header h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.tagline {
    font-size: 1.2em;
    opacity: 0.95;
    margin-bottom: 30px;
}

.header-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn, .btn-sm {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

button {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

button:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
    background: #f44336;
}

.btn-sm:hover {
    background: #da190b;
}

/* Main Content */
main {
    padding: 40px 0;
}

section {
    background: white;
    margin-bottom: 40px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #764ba2;
    margin-bottom: 10px;
}

h4 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feature:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.feature h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
}

/* Info Boxes */
.info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.info-box {
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.license-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.docs-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.info-box h3 {
    color: white;
    margin-bottom: 15px;
}

.info-box p {
    margin-bottom: 20px;
    opacity: 0.95;
}

.info-box .btn-secondary {
    background: white;
    color: #667eea;
    border: none;
}

.info-box .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Code Examples */
pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 0.9em;
    line-height: 1.5;
}

code {
    font-family: 'Courier New', Courier, monospace;
}

p code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63384;
    font-size: 0.9em;
}

/* Demo Sections */
.demo-section {
    border-left: 5px solid #667eea;
}

.demo-container {
    margin: 20px 0;
}

.demo-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

input[type="text"],
input[type="number"] {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.result-area {
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    min-height: 100px;
}

/* List Styles */
#todo-list,
#user-list,
#array-list,
#helper-list {
    list-style: none;
}

#todo-list li,
#user-list li,
#array-list li,
#helper-list li {
    background: white;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#todo-list li:hover,
#user-list li:hover,
#array-list li:hover,
#helper-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.todo-item {
    flex: 1;
}

/* Advanced Todo Styling */
.todo-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.todo-item-row.done .todo-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.todo-text {
    flex: 1;
    font-size: 1em;
}

.todo-actions {
    display: flex;
    gap: 5px;
}

.btn-edit {
    background: #2196f3;
}

.btn-edit:hover {
    background: #0b7dda;
}

.btn-remove {
    background: #f44336;
}

.btn-remove:hover {
    background: #da190b;
}

.btn-done {
    background: #4caf50;
}

.btn-done:hover {
    background: #45a049;
}

button.done {
    background: #4caf50;
    cursor: default;
}

button.done:hover {
    background: #4caf50;
    transform: none;
}

/* Product Cards */
.product-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #764ba2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Message Cards */
.message-card {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Department Cards */
.department-card {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.department-card h4 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.department-card ul {
    list-style: none;
}

.department-card li {
    background: #f8f9fa;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #764ba2;
}

/* Code Example Accordion */
details {
    margin-top: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    user-select: none;
    padding: 5px;
}

summary:hover {
    color: #764ba2;
}

details[open] summary {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Helper Demo */
.helper-item {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
}

.helper-item .item-text {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.helper-item button {
    margin-right: 5px;
}

.output {
    background: #2d2d2d;
    color: #4caf50;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    min-height: 60px;
    font-size: 0.9em;
}

.info {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    font-weight: 600;
}

.status-text {
    margin-left: 15px;
    padding: 8px 15px;
    background: #4caf50;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Reddit Demo */
#reddit-area.loading {
    position: relative;
    min-height: 200px;
}

#reddit-area.loading::after {
    content: "Loading Reddit posts...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #667eea;
    font-weight: 600;
}

.reddit-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reddit-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #FF4500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.reddit-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.reddit-score {
    background: #FF4500;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2em;
    min-width: 60px;
    text-align: center;
    align-self: flex-start;
}

.reddit-content {
    flex: 1;
    min-width: 0;
}

.reddit-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    line-height: 1.4;
}

.reddit-title a {
    color: #0079d3;
    text-decoration: none;
}

.reddit-title a:hover {
    text-decoration: underline;
}

.reddit-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.reddit-author {
    font-weight: 600;
}

.reddit-comments {
    color: #667eea;
    text-decoration: none;
}

.reddit-comments:hover {
    text-decoration: underline;
}

select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

/* Docs Section */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.docs-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.docs-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.docs-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.docs-card ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.docs-card li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.docs-card li:last-child {
    border-bottom: none;
}

.docs-cta {
    text-align: center;
    margin-top: 40px;
}

.btn-large {
    font-size: 1.2em;
    padding: 15px 40px;
}

/* Footer */
footer {
    background: #2d2d2d;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5em;
    }

    section {
        padding: 25px;
    }

    .demo-controls {
        flex-direction: column;
    }

    input[type="text"],
    input[type="number"] {
        width: 100%;
    }
}
