/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --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), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

/* Main Content */
.main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

/* Topics Section */
.topics-section {
    padding: 3rem 0;
    background: var(--bg-secondary);
}

.progress-section {
    padding: 3rem 0;
    background: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}



/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.topic-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.topic-card:hover::before {
    left: 100%;
}

.topic-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.topic-icon i {
    font-size: 1.5rem;
    color: white;
}

.topic-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.topic-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.topic-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.topic-progress span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
}

/* Progress Overview */
.progress-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.overall-progress {
    display: flex;
    justify-content: center;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s ease;
}

.progress-ring-fill {
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Topic Page Styles */
.topic-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.topic-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.topic-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.section {
    margin-bottom: 3rem;
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.concept-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.concept-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.concept-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.concept-card p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.concept-details {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 0.75rem;
}

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

.example-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.example-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.activity-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.activity-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.activity-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.activity-item p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.activity-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.resource-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.resource-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.resource-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.resource-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animations */
.concept-card {
    animation: fadeInUp 0.6s ease-out;
}

.visual-diagram {
    animation: fadeInUp 0.8s ease-out;
}

.acid-item {
    animation: slideInLeft 0.6s ease-out;
}

.nosql-type {
    animation: slideInRight 0.6s ease-out;
}

.advantage-item {
    animation: fadeInUp 0.6s ease-out;
}

.use-case {
    animation: slideInLeft 0.6s ease-out;
}

.challenge {
    animation: slideInRight 0.6s ease-out;
}

/* Hover animations */
.tree-node:hover {
    animation: pulse 0.3s ease-in-out;
}

.nosql-type:hover {
    animation: pulse 0.3s ease-in-out;
}

.advantage-item:hover {
    animation: pulse 0.3s ease-in-out;
}

/* Navigation Links */
.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

/* Visual Diagrams and Interactive Elements */
.visual-diagram {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.visual-diagram h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Classification Tree */
.classification-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tree-node {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    color: white;
}

.tree-node.root {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-weight: 600;
}

.node-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: white;
}

.tree-branches {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tree-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tree-leaves {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leaf {
    background: #e3f2fd;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--primary-color);
    border: 1px solid #bbdefb;
}

/* Comparison Table */
.comparison-table {
    overflow-x: auto;
    margin: 1rem 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* Concept Index */
.concept-index {
    margin-bottom: 2rem;
}

.concept-index-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--success-color);
}

.concept-index-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.concept-index-card h3 i {
    color: var(--success-color);
}

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

.concept-list li {
    margin-bottom: 0.5rem;
}

.concept-list li:last-child {
    margin-bottom: 0;
}

.concept-list a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.concept-list a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(5px);
}

.concept-list a i {
    color: var(--success-color);
    font-size: 0.875rem;
}

/* Relational Model */
.relational-model {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.table-diagram {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    min-width: 300px;
}

.table-header {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    font-weight: 600;
}

.table-structure {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.column {
    flex: 1;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-right: 1px solid #e9ecef;
}

.column.primary-key {
    background: #e8f5e8;
    color: #2e7d32;
}

.column.foreign-key {
    background: #fff3e0;
    color: #f57c00;
}

.table-data {
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
}

.row:last-child {
    border-bottom: none;
}

.cell {
    flex: 1;
    padding: 0.5rem;
    border-right: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.cell.pk {
    background: #e8f5e8;
    color: #2e7d32;
    font-weight: 600;
}

.cell.fk {
    background: #fff3e0;
    color: #f57c00;
    font-weight: 600;
}

.relationship-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* ACID Properties */
.acid-properties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.acid-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.acid-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.acid-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.acid-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* NoSQL Types */
.nosql-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.nosql-type {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.nosql-type:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.type-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.nosql-type h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nosql-type p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.type-example {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
}

/* Advantages Grid */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.advantage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.advantage-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.advantage-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.advantage-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.advantage-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Memory Architecture */
.memory-architecture {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.memory-layer {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 250px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.memory-layer.main {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: var(--primary-color);
}

.layer-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.layer-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.memory-section {
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin: 0.25rem 0;
}

.section-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.section-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.use-case {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-color);
}

.case-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.case-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.case-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Distributed Architecture */
.distributed-architecture {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.client-layer,
.coordinator-layer,
.nodes-layer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.client,
.coordinator,
.node {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    min-width: 120px;
}

.coordinator {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: var(--primary-color);
}

.node {
    background: #f8f9fa;
}

.node-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.node-content {
    font-size: 0.9rem;
    color: white;
}

.arrow-down {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* CAP Triangle */
.cap-triangle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
}

.cap-corner {
    position: absolute;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 120px;
}

.cap-corner:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.cap-corner:nth-child(2) {
    bottom: 0;
    left: 0;
}

.cap-corner:nth-child(3) {
    bottom: 0;
    right: 0;
}

.corner-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.corner-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cap-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: var(--shadow-lg);
}

/* Challenges and Solutions */
.challenges-solutions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.challenge {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.challenge:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.challenge h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.challenge p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.challenge strong {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1rem;
    }

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

    .progress-overview {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

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

    /* Visual Diagrams Responsive */
    .visual-diagram {
        padding: 1rem;
        margin: 1rem 0;
    }

    .tree-branches {
        flex-direction: column;
        align-items: center;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .relational-model {
        gap: 0.5rem;
    }

    .table-diagram {
        min-width: 250px;
    }

    .acid-properties {
        grid-template-columns: 1fr;
    }

    .nosql-types {
        grid-template-columns: 1fr;
    }

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

    .use-cases {
        grid-template-columns: 1fr;
    }

    .challenges-solutions {
        grid-template-columns: 1fr;
    }

    .cap-triangle {
        width: 250px;
        height: 250px;
    }

    .cap-corner {
        width: 100px;
        padding: 0.75rem;
    }

    .cap-center {
        width: 60px;
        height: 60px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .section {
        padding: 1.5rem;
    }

    .topic-header {
        padding: 2rem 0;
    }

    .topic-header h1 {
        font-size: 2rem;
    }
}

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

.tab-content.active {
    animation: fadeIn 0.5s ease;
}

.topic-card {
    animation: fadeIn 0.3s ease;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estilos para Normalización de Bases de Datos */
.normalization-process {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

/* Estilos para Dependencias Funcionales y Transitivas */
.dependency-diagram {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.dependency-type {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-width: 300px;
    flex: 1;
}

.dependency-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.dependency-box {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.dependency-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 0.5rem;
}

.dependency-transitive {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

.example-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.example-section h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.normalization-step {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-width: 150px;
    transition: all 0.3s ease;
}

.normalization-step:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0 auto 1rem;
}

.step-content h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.step-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.table-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.table-before, .table-after {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table-before {
    border-left: 4px solid var(--error-color);
}

.table-after {
    border-left: 4px solid var(--success-color);
}

.table-before h5, .table-after h5 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.table-before h5 {
    color: var(--error-color);
}

.table-after h5 {
    color: var(--success-color);
}

.normalization-methodology {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.method-step {
    background: white;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-width: 120px;
    transition: all 0.3s ease;
}

.method-step:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.step-icon {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
}

.method-step h5 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.method-step p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.benefit-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.benefit-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive para elementos de normalización */
@media (max-width: 768px) {
    .normalization-process {
        flex-direction: column;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .table-comparison {
        grid-template-columns: 1fr;
    }
    
    .normalization-methodology {
        flex-direction: column;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .dependency-diagram {
        flex-direction: column;
        align-items: center;
    }
    
    .dependency-type {
        min-width: 280px;
        width: 100%;
    }
    
    .dependency-visual {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dependency-arrow {
        transform: rotate(90deg);
    }
}