@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #f02d5b; /* Vibrant pink/red like Instagram gradients */
    --primary-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --secondary: #A29BFE;
    --accent: #00CEC9;
    --background: #fafafa;
    --surface: #ffffff;
    --text: #262626;
    --text-muted: #8e8e8e;
    --border: #dbdbdb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    margin: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.5;
}

/* App Container limits max-width to look like a mobile app on desktop */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface);
    position: relative;
    box-shadow: var(--shadow-lg);
}

/* Typography */
h1, h2, h3, h4 { margin-top: 0; }

/* Form Elements */
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    background-color: var(--background);
}

input:focus, select:focus, textarea:focus {
    border-color: #a8a8a8;
    background-color: var(--surface);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Instagram-like Post Card */
.post-card {
    background: var(--surface);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.post-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
}

.avatar-ring {
    padding: 2px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: inline-block;
}

.post-media {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    background: #000; /* Black background for videos/photos */
}

.post-actions {
    padding: 10px 16px;
    display: flex;
    gap: 16px;
}

.action-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    transition: 0.2s;
}
.action-btn:hover { color: var(--text-muted); }
.action-btn.liked { color: var(--primary); }

.post-content {
    padding: 0 16px 16px 16px;
}

.post-tags {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-student {
    background: var(--background);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.post-caption {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 8px;
    display: block;
}

/* Comments Section */
.comments-section {
    margin-top: 8px;
}

.comment {
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.comment-author {
    font-weight: 600;
    margin-right: 4px;
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.comment-input {
    flex: 1;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    font-size: 0.9rem;
}
.comment-input:focus { border: none; }

.comment-submit {
    color: var(--primary);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Stories Bar (Student Filter) */
.stories-container {
    display: flex;
    overflow-x: auto;
    padding: 16px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: none; /* Firefox */
}
.stories-container::-webkit-scrollbar { display: none; }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 65px;
    transition: 0.2s;
}

.story-item.active .story-avatar-wrapper {
    background: var(--primary-gradient);
}
.story-item.active .story-name {
    font-weight: 600;
    color: var(--text);
}

.story-avatar-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 2px;
    background: var(--border); /* Unselected state */
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-avatar {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: bold;
    overflow: hidden;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65px;
}

/* Navigation Bottom Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 999;
}

.nav-item {
    color: var(--text);
    font-size: 1.5rem;
    text-decoration: none;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    transform: scale(1.1);
}

/* Floating Action Button (New Post) */
.fab-post { 
    position: fixed; 
    bottom: 80px; 
    right: 20px; 
    width: 56px; 
    height: 56px; 
    background: var(--primary-gradient); 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem; 
    border: none; 
    box-shadow: var(--shadow-md); 
    cursor: pointer; 
    z-index: 1000; 
    transition: 0.2s;
}
.fab-post:active { transform: scale(0.9); }

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--surface);
    margin: 10% auto;
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: bold; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }

/* Dashboard Cards (Admin/Gerenciamento) */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 16px; 
    margin-top: 20px; 
}
.nav-card { 
    background: var(--surface); 
    padding: 24px 16px; 
    border-radius: var(--radius-md); 
    text-align: center; 
    text-decoration: none; 
    color: var(--text); 
    box-shadow: var(--shadow-sm); 
    border: 1px solid var(--border);
    transition: 0.2s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px; 
}
.nav-card:hover { 
    box-shadow: var(--shadow-md); 
    border-color: var(--primary);
}
.nav-card i { font-size: 2rem; color: var(--primary); }
.nav-card span { font-weight: 600; font-size: 0.9rem; }

/* Header app */
.app-header {
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 998;
}

.app-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

