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

:root {
    --cyan: #3EEDE7;
    --dark-blue: #053154;
    --dark-bg: #161823;
    --white: #FFFFFF;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--dark-bg);
    color: var(--white);
}

/* Header */
.header {
    background-color: var(--dark-blue);
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--cyan);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--cyan), var(--dark-blue));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyan);
}

.header-actions {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.header-search-row {
    display: flex;
    flex: 1 1 320px;
    min-width: 0;
    gap: 0.75rem;
    align-items: center;
}

.subject-tools {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mobile-panel-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.mobile-panel-toggle img {
    width: 20px;
    height: 20px;
    display: block;
}

.search-bar {
    background-color: var(--dark-bg);
    border: 1px solid var(--cyan);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--white);
    width: auto;
    flex: 1;
    min-width: 0;
}

.search-bar::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn {
    background-color: var(--cyan);
    color: var(--dark-blue);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background-color: var(--white);
    transform: translateY(-2px);
}

/* Main Container */
.container {
    display: flex;
    min-height: auto;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--dark-blue);
    border-right: 2px solid var(--cyan);
    padding: 1.5rem;
}

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

.section-title {
    color: var(--cyan);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.subject-list {
    list-style: none;
}

.subject-item {
    margin-bottom: 0.5rem;
}

.subject-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(62, 237, 231, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.subject-header:hover {
    background-color: rgba(62, 237, 231, 0.2);
}

.subject-icon {
    color: var(--cyan);
    font-size: 1.2rem;
}

.subject-name {
    flex: 1;
    font-weight: 500;
}

.subject-badge {
    background-color: var(--cyan);
    color: var(--dark-blue);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subsections {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.subsection-item {
    display: block;
    width: 100%;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.3s;
}

.subsection-item:hover {
    color: var(--cyan);
    border-left-color: var(--cyan);
}

/* Workspace */
.workspace {
    flex: 1;
    background-color: var(--dark-bg);
    padding: 2rem;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

.toolbar {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    background-color: var(--dark-blue);
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.tool-btn:hover {
    background-color: var(--cyan);
    color: var(--dark-blue);
}

.tool-btn.is-active {
    background-color: var(--cyan);
    color: var(--dark-blue);
    box-shadow: 0 0 0 2px rgba(62, 237, 231, 0.25);
}

.tool-btn.is-active:hover {
    background-color: var(--white);
    color: var(--dark-blue);
}

/* Content Blocks */
.content-block {
    background-color: var(--dark-blue);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
    scroll-margin-top: 88px;
}

.content-block.is-hidden {
    display: none;
}

.content-block:hover {
    border-color: var(--cyan);
}

.block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.block-icon {
    width: 24px;
    height: 24px;
    background-color: var(--cyan);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-blue);
    font-weight: bold;
}

.block-type {
    color: var(--cyan);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.block-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Resource Block */
.resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(62, 237, 231, 0.1);
    border-radius: 6px;
    margin-top: 0.5rem;
    text-decoration: none;
    color: var(--cyan);
    transition: all 0.3s;
}

.resource-link:hover {
    background-color: rgba(62, 237, 231, 0.2);
}

/* Task Block */
.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-top: 0.5rem;
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--cyan);
    border-radius: 4px;
    cursor: pointer;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.status-progress {
    background-color: rgba(62, 237, 231, 0.2);
    color: var(--cyan);
}

/* Notes Block */
.note-editor {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(62, 237, 231, 0.3);
    border-radius: 6px;
    padding: 1rem;
    min-height: 150px;
    color: var(--white);
    margin-top: 0.5rem;
}

.note-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: var(--dark-bg);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* PDF Viewer Block */
.pdf-viewer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.pdf-display {
    background-color: var(--white);
    border-radius: 6px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
}

.pdf-annotations {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(62, 237, 231, 0.3);
    border-radius: 6px;
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--white);
}

/* Mejoras adicionales para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .tool-btn,
    .subject-header,
    .subsection-item,
    .resource-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .checkbox {
        width: 24px;
        height: 24px;
    }
}
