/* ==========================================================================
   MeetNTalk - Hybrid CSS Architecture with Tailwind CSS
   ========================================================================== */

/* CSS Custom Properties for consistent theming */
:root {
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-secondary: #6b7280;
    --color-secondary-hover: #4b5563;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    color: var(--color-primary-hover);
}

.back-link:before {
    content: "←";
    margin-right: 0.5rem;
}

/* ==========================================================================
   Button Components
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

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

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

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

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

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

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

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

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

.btn-outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

.btn-outline.btn-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

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

.btn-outline.btn-success {
    color: var(--color-success);
    border-color: var(--color-success);
}

.btn-outline.btn-success:hover {
    background-color: var(--color-success);
    color: white;
}

/* ==========================================================================
   Card Components
   ========================================================================== */

.card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.card-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.event-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition:
        box-shadow 0.2s ease-in-out,
        transform 0.2s ease-in-out;
}

.event-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transform: translateY(-1px);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.event-card-title {
    flex: 1;
}

.event-card-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Form Components
   ========================================================================== */

.form-container {
    max-width: 42rem;
    margin: 0 auto;
}

.form-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-label.required:after {
    content: " *";
    color: var(--color-danger);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition:
        border-color 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 8rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
}

/* ==========================================================================
   Alert Components
   ========================================================================== */

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #bbf7d0;
    color: #065f46;
}

/* ==========================================================================
   Grid Components
   ========================================================================== */

.events-grid {
    display: grid;
    gap: 1rem;
}

.events-empty {
    text-align: center;
    padding: 3rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.events-empty-text {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.events-empty-action {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.events-empty-action:hover {
    color: var(--color-primary-hover);
}

.events-count {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ==========================================================================
   Header Components
   ========================================================================== */

.app-header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.app-header-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.app-title:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

.content-section {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}

.content-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.content-description {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.markdown-content {
    color: #374151;
    line-height: 1.625;
}

.markdown-content > :first-child,
.markdown-preview > :first-child {
    margin-top: 0;
}

.markdown-content > :last-child,
.markdown-preview > :last-child {
    margin-bottom: 0;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content pre,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6,
.markdown-preview p,
.markdown-preview ul,
.markdown-preview ol,
.markdown-preview blockquote,
.markdown-preview pre,
.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    margin: 0.75rem 0;
}

.markdown-content ul,
.markdown-content ol,
.markdown-preview ul,
.markdown-preview ol {
    padding-left: 1.25rem;
}

.markdown-content ul {
    list-style: disc outside;
}

.markdown-content ol {
    list-style: decimal outside;
}

.markdown-preview ul {
    list-style: disc inside;
}

.markdown-preview ol {
    list-style: decimal inside;
}

.markdown-content h1,
.markdown-preview h1 {
    color: #111827;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.markdown-content h2,
.markdown-preview h2 {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

.markdown-content h3,
.markdown-preview h3 {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h4,
.markdown-preview h4 {
    color: #111827;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.markdown-content h5,
.markdown-content h6,
.markdown-preview h5,
.markdown-preview h6 {
    color: #111827;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.markdown-content blockquote,
.markdown-preview blockquote {
    border-left: 3px solid #d1d5db;
    color: #4b5563;
    padding-left: 1rem;
}

.markdown-content a,
.markdown-preview a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.markdown-content code,
.markdown-preview code {
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.875em;
    padding: 0.1rem 0.3rem;
}

.markdown-content pre,
.markdown-preview pre {
    background-color: #111827;
    border-radius: 0.5rem;
    color: #f9fafb;
    overflow-x: auto;
    padding: 0.75rem 1rem;
}

.markdown-content pre code,
.markdown-preview pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-preview {
    max-height: 3.75rem;
    overflow: hidden;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.divider {
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* ==========================================================================
   Slot Type Badges
   ========================================================================== */

.slot-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slot-type-badge-lg {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.slot-type-talk {
    background-color: #dbeafe;
    color: #1e40af;
}

.slot-type-paneldiscussion {
    background-color: #fce7f3;
    color: #9f1239;
}

.slot-type-workshop {
    background-color: #dcfce7;
    color: #166534;
}

.slot-type-break {
    background-color: #fef3c7;
    color: #92400e;
}

.slot-type-other {
    background-color: #f3f4f6;
    color: #374151;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .card-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .event-card-header {
        flex-direction: column;
        gap: 1rem;
    }

    .event-card-title {
        flex: none;
    }
}
