/* ============================================
   TABLON - I.E.P.E. Apóstol Pablo
   Solo estilos especificos de esta pagina
   (Los componentes reutilizables estan en components.css)
   ============================================ */

/* ============================================
   LAYOUT 3 COLUMNAS
   ============================================ */
.tablon-page {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
}

.center-column {
    min-width: 0;
}

/* ============================================
   PERFIL CARD
   ============================================ */
.profile-card {
    text-align: center;
}

.profile-header {
    margin-bottom: 1rem;
}

.profile-logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.school-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   USUARIOS ONLINE
   ============================================ */
.users-online-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-online-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-online-avatar {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-online-info {
    display: flex;
    flex-direction: column;
}

.user-online-name {
    font-weight: 500;
    color: var(--text-dark);
}

.user-online-role {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.no-users {
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

/* ============================================
   CALENDAR WIDGET
   ============================================ */
.calendar-widget {
    background: white;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-day {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.calendar-date-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.calendar-weekday {
    font-weight: 500;
    color: var(--text-dark);
    text-transform: capitalize;
}

.calendar-month {
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: capitalize;
}

.btn-add-event {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

.btn-add-event svg {
    width: 18px;
    height: 18px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-events {
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.no-events-icon {
    display: flex;
    justify-content: center;
}

.no-events-icon svg {
    width: 60px;
    height: 60px;
    color: #d1d5db;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
}

.event-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    min-width: 45px;
}

.event-title {
    font-size: 0.9rem;
    color: #374151;
}

/* ============================================
   BIRTHDAY WIDGET
   ============================================ */
.birthday-widget .birthday-content {
    text-align: center;
}

.birthday-widget .birthday-icon svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
}

.birthday-widget .birthday-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.birthday-widget .birthday-count {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.btn-see-all {
    background: none;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* ============================================
   CONTABILIDAD CHART
   ============================================ */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-color.egresos {
    background: #f97316;
}

.legend-color.ingresos {
    background: #22c55e;
}

.mini-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    height: 80px;
}

.chart-bar .bar {
    width: 30px;
    border-radius: 4px 4px 0 0;
}

.chart-bar .bar.egresos {
    background: #f97316;
}

.chart-bar .bar.ingresos {
    background: #22c55e;
}

.chart-labels {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ============================================
   SOCIAL LINKS
   ============================================ */
.social-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.social-btn:hover {
    transform: scale(1.1);
}

.social-btn svg {
    width: 18px;
    height: 18px;
}

.social-btn.facebook {
    background: #1877f2;
    color: white;
}

.social-btn.twitter {
    background: #1da1f2;
    color: white;
}

.social-btn.youtube {
    background: #ff0000;
    color: white;
}

.social-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem;
}

.card-header-line .card-title {
    margin: 0;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   REACTION BUTTONS
   ============================================ */
.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

.reaction-btn.liked {
    color: #ef4444;
}

.reaction-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.loading-card p {
    color: #6b7280;
}

/* ============================================
   CREAR POST
   ============================================ */
.create-post {
    margin-bottom: 1.5rem;
}

.post-input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar,
.author-avatar {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.post-input-area {
    flex: 1;
}

.post-input-area textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 0.95rem;
    color: #374151;
    outline: none;
    font-family: inherit;
}

.post-input-area textarea::placeholder {
    color: #9ca3af;
}

.post-attachments {
    margin-top: 0.5rem;
}

label.attach-btn,
.attach-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.85rem;
}

.attach-btn svg {
    width: 18px;
    height: 18px;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.post-tools {
    display: flex;
    gap: 0.5rem;
}

.btn-publish {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.btn-publish:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-publish svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   POST CARDS
   ============================================ */
.post-card {
    margin-bottom: 1rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-author {
    display: flex;
    gap: 0.75rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
}

.post-date {
    font-size: 0.8rem;
    color: var(--color-primary);
}

.post-menu {
    display: flex;
    gap: 0.25rem;
}

.post-content p {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.post-footer {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.empty-feed {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* ============================================
   ATTACH BUTTON CON ARCHIVO
   ============================================ */
.attach-btn.has-file {
    background: #e0f2fe;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.attach-btn .remove-file,
.attached-file-preview .remove-file {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.attached-file-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f3f4f6;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #374151;
}

/* ============================================
   TOOL BUTTONS
   ============================================ */
label.tool-btn,
.tool-btn {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
    position: relative;
}

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

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

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.tool-btn .file-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   VIDEO INPUT
   ============================================ */
.video-input-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.video-url-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.video-url-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-add-video,
.btn-cancel-video {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.btn-add-video:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cancel-video {
    background: #e5e7eb;
    color: #374151;
}

/* ============================================
   POST DROPDOWN MENU
   ============================================ */
.post-menu {
    position: relative;
}

.menu-btn,
.flag-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.menu-btn:hover,
.flag-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.menu-btn svg,
.flag-btn svg {
    width: 18px;
    height: 18px;
}

.post-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.post-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: background 0.2s ease;
}

.post-dropdown-menu button:hover {
    background: #f3f4f6;
}

.post-dropdown-menu button svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-section {
    padding: 1rem 0 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.comments-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.no-comments {
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.comment-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

.comment-text {
    font-size: 0.9rem;
    color: #374151;
    margin: 0.25rem 0 0;
}

.add-comment {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.comment-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 0.9rem;
}

.comment-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-send-comment {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.btn-send-comment:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-send-comment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send-comment svg {
    width: 16px;
    height: 16px;
}

.reaction-btn.active {
    color: var(--color-primary);
    font-weight: 500;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-lg {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Form Groups */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-danger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Report Modal */
.report-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.report-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-option:hover {
    border-color: var(--color-primary);
    background: #f9fafb;
}

.report-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.report-description {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    resize: vertical;
}

/* Birthday Modal */
.birthday-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.birthday-avatar {
    width: 40px;
    height: 40px;
    background: #f472b6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.birthday-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.birthday-name {
    font-weight: 500;
    color: var(--text-dark);
}

.birthday-date {
    font-size: 0.85rem;
    color: #6b7280;
}

.birthday-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #e5e7eb;
    color: #374151;
}

.birthday-type.badge-estudiante {
    background: #dbeafe;
    color: #1e40af;
}

.birthday-type.badge-docente {
    background: #dcfce7;
    color: #166534;
}

.loading-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6b7280;
}

.no-data {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .tablon-page {
        grid-template-columns: 1fr 300px;
    }
    .left-column {
        display: none;
    }
}

@media (max-width: 900px) {
    .tablon-page {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    .right-column {
        display: none;
    }
}

@media (max-width: 640px) {
    .tablon-page {
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .post-input-wrapper {
        flex-direction: column;
    }

    .post-avatar,
    .author-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .post-avatar {
        align-self: flex-start;
    }

    .post-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .post-tools {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-publish {
        width: 100%;
        justify-content: center;
    }

    .post-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .author-name {
        font-size: 0.9rem;
    }

    .post-date {
        font-size: 0.75rem;
    }
}

@media (max-width: 400px) {
    .tablon-page {
        padding: 0;
    }

    .post-footer {
        justify-content: space-between;
    }
}
