* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #45B7D1 100%);
    color: white;
    padding: 0;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 30px;
}

.banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.banner-left {
    flex: 1;
}

.school-info h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: bold;
}

.school-info p {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 0;
}

.banner-right {
    flex: 1;
    text-align: right;
}

.parana-logo {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.classes-inline {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.class-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85em;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.banner-title {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.banner-title h1 {
    font-size: 3.5em;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    margin: 0;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.banner-title h1::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    right: -20px;
    bottom: -10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    z-index: -1;
    transform: rotate(-2deg);
}

.banner-bottom {
    margin-top: 20px;
}

.contact-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-info p {
    margin: 5px 0;
    font-size: 0.9em;
    font-weight: 500;
}

.contact-info strong {
    color: #FFD700;
    font-weight: bold;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.legend {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.legend h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 5px;
    transition: transform 0.2s;
}

.legend-item:hover {
    transform: translateX(5px);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid #333;
}

.controls {
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.month-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.month-selector select {
    padding: 10px 15px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.month-selector select:hover {
    border-color: #2980b9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn:disabled,
.month-selector select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#calendarHeader {
    transition: opacity 0.2s;
}

.calendar-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.calendar-container {
    padding: 30px;
}

.calendar {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.calendar-header {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.weekday {
    background: #2c3e50;
    color: white;
    padding: 15px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
}

.calendar-day {
    min-height: 80px;
    border: 1px solid #dee2e6;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: white;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.event-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 2px;
    display: inline-block;
}

.meeting-item {
    background: #fff9c4 !important;
    border: 2px solid #fbc02d !important;
    color: #000 !important;
    border-radius: 4px !important;
    padding: 5px 10px !important;
    margin: 5px 0 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    position: relative !important;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4) !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    text-transform: uppercase !important;
    display: block !important;
    min-height: 20px !important;
}

.meeting-item:hover {
    background: #fff176;
    transform: scale(1.02);
    z-index: 5;
}

.meeting-item.editing {
    background: white;
    border-color: #00CED1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.meeting-input {
    width: 100%;
    border: none;
    background: white;
    font-size: 1em;
    padding: 2px;
    outline: 2px solid #fbc02d;
    font-family: inherit;
    color: #000;
}

.meeting-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.meeting-item:hover .meeting-delete {
    display: block;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 18px;
    border-radius: 8px;
    color: white;
    font-size: 0.95em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.toast-error { background: #e74c3c; }
.toast-success { background: #27ae60; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ------------------------------------------------------------------ acesso */

/* Sem esta regra o JavaScript nao consegue esconder nada: ele so acrescenta a
   classe, quem some com o elemento e o CSS. */
.hidden {
    display: none !important;
}

.page-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 30px;
    background: #2c3e50;
    font-size: 0.9em;
}

.page-nav a,
.page-nav span {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}

.page-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* A pagina em que voce ja esta e um <span>, nao um link. */
.page-nav span {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.auth-panel {
    padding: 40px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.auth-icon {
    font-size: 2.2em;
    line-height: 1;
    margin-bottom: 14px;
}

.auth-card h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 26px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-group label {
    font-size: 0.85em;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.auth-button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    background: #3498db;
    color: white;
    font-size: 1em;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.35);
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.admin-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 30px;
    background: #eafaf1;
    border-bottom: 1px solid #d4efdf;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-info p {
    color: #1e8449;
    font-size: 0.95em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.btn-sair {
    background: #e74c3c;
    color: white;
}

.btn-sair:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.admin-message {
    padding: 14px 30px;
    background: #fef9e7;
    border-bottom: 1px solid #f9e79f;
    color: #7d6608;
    font-size: 0.9em;
    text-align: center;
}

/* Deslogado o evento nao responde a clique: o cursor nao deve prometer que sim. */
.meeting-item.readonly {
    cursor: default !important;
}

.color-yellow { background-color: #FFD700 !important; }
.color-blue { background-color: #4169E1 !important; }
.color-light-green { background-color: #90EE90 !important; }
.color-dark-green { background-color: #228B22 !important; }
.color-black { background-color: #2c3e50 !important; color: white; }
.color-red { background-color: #DC143C !important; color: white; }
.color-orange { background-color: #FF8C00 !important; }
.color-light-blue { background-color: #ADD8E6 !important; }
.color-pink { background-color: #FFB6C1 !important; }
.color-purple { background-color: #9370DB !important; }
.color-cyan { background-color: #00CED1 !important; }
.color-grey { background-color: #bdc3c7 !important; }

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calendar-day {
        min-height: 60px;
        font-size: 0.8em;
    }

    .page-nav,
    .admin-status,
    .admin-message {
        padding-left: 15px;
        padding-right: 15px;
    }

    .auth-panel {
        padding: 25px 15px;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .admin-status {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .status-info {
        justify-content: center;
    }
}
