/* === LOGIN E CADASTRO === */
@media (max-width: 1024px) {
    .logo {
        width: 250px;
    }
    
    .form-logo {
        width: 250px; 
    }
    
    .logo-container p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        display: none;
    }
    
    .login-form {
        padding: 40px 20px;
        min-height: 100vh;
    }

    .form-logo {
        width: 300px; 
        margin-bottom: 30px;
    }
    
    .form-container {
        padding: 20px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .login-form {
        padding: 30px 15px;
    }
    
    .form-logo {
        width: 250px;
        margin-bottom: 25px;
    }
    
    .form-container {
        padding: 15px;
    }
    .form-group {
            margin-bottom: 15px;
    }

    input[type="text"],
    input[type="password"] {
        padding: 10px 14px;
    }

    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* === SIDEBAR COMPARTILHADA - TODAS PÁGINAS === */
@media (max-width: 991px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .username {
        font-size: 1.1rem;
        max-width: 140px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
    }
    
    .sidebar {
        transform: translateX(-100%);
        display: flex !important;
        width: 260px;
        z-index: 1000;
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .main-content {
        margin-left: 0;
        padding: 5rem 1.5rem 1.5rem 1.5rem;
    }
    
    .header {
        flex-direction: column;
        align-items: center; 
        gap: 1rem;
        text-align: center;
        padding-top: 60px;
    }
    
    .nav-link, 
    .logout {
        padding: 12px 2rem;
        display: flex;
        align-items: center;
    }
    
    .nav-link svg,
    .logout svg {
        margin-right: 12px;
        min-width: 20px; 
    }
    
    .nav-link.active {
        position: relative;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link.active:before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background-color: white;
    }
}

/* === SIDEBAR DENTRO DO AMBIENTE === */
@media (max-width: 768px) {
    .ambient-menu-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem; 
        z-index: 998;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: #4361ee;
        color: white;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        border: none;
    }
    
    .ambient-menu-toggle svg {
        display: none;
    }
    
    .ambient-menu-toggle:before {
        content: "";
        display: block;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
    }
    
    .ambient-page .header {
        padding-top: 60px;
        padding-right: 10px;
    }
}

/* === ITEMIZAÇÃO ESPECÍFICA PARA HOME === */
@media (max-width: 576px) {
    .home-page .ambients-grid {
        grid-template-columns: 1fr; 
    }
    
    .home-page .ambient-card {
        max-width: 100%;
    }
    
    .home-page .no-ambients {
        padding: 2rem 1rem;
    }
    
    .home-page .action-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .home-page .create-button,
    .home-page .join-button {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem 0;
        justify-content: center;
        text-align: center;
    }
    
    .logo {
        width: 70px; 
    }
    
    .user-info {
        margin-bottom: 2rem;
    }
}

/* === CRIAÇÃO DE AMBIENTE - MANTER APENAS ESTILOS DOS BOTÕES === */
@media (max-width: 768px) {
    .create-ambient-page .action-buttons {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.5rem;
    }
}

@media (max-width: 576px) {
    .create-ambient-page .form-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 10px;
    }
    
    .create-ambient-page .cancel-button,
    .create-ambient-page .create-button {
        width: 100%;
        max-width: 300px;
        height: 42px;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 15px;
        font-size: 1rem;
        text-decoration: none;
        box-sizing: border-box;
    }
    
    .create-ambient-page .cancel-button {
        background-color: #f3f4f6;
        color: #1f2937;
        border: 1px solid #d1d5db;
    }
    
    .create-ambient-page .create-button {
        background-color: #4361ee;
        color: white;
        border: 1px solid #3754d1;
    }
}

/* === CONFIGURAÇÃO DO AMBIENTE === */
@media (max-width: 991px) {
    .config-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .ambient-config-page .header {
        margin-top: 60px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 1.5rem;
    }
    
    .ambient-config-page .action-buttons {
        align-self: flex-start;
    }
    
    .config-container {
        margin-bottom: 30px;
    }
    
    .config-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .config-section h2 {
        text-align: left;
    }
    
    .file-input-placeholder {
        height: 45px;
    }
    
    .form-row {
        flex-direction: column;
        margin: 0;
    }
    
    .form-group.half {
        margin: 0 0 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .config-container {
        padding: 1.25rem;
        border-radius: 8px;
    }
    
    .ambient-config-page .header h1 {
        font-size: 1.5rem;
    }
    
    .config-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cancel-button,
    .save-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ambient-config-page .header h1 {
        font-size: 1.4rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group input[type="date"],
    .form-group textarea {
        font-size: 0.95rem;
        padding: 10px;
    }
}

/* === RECURSOS DO AMBIENTE === */
@media (max-width: 768px) {
    .ambient-resources-page .header {
        margin-top: 60px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 1.5rem;
    }
    
    .ambient-resources-page .action-buttons {
        align-self: flex-start;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .ambient-resources-page .header h1 {
        font-size: 1.5rem;
    }
    
    .resource-card {
        padding: 20px;
    }
    
    .resource-icon {
        width: 60px;
        height: 60px;
    }
    
    .resource-card h3 {
        font-size: 1.1rem;
    }
}

/* === PERFIL DO AMBIENTE === */
@media (max-width: 991px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-image {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .ambient-profile-page .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ambient-profile-page .action-buttons {
        width: 100%;
    }
    
    .ambient-profile-page .back-button {
        width: 100%;
        justify-content: center;
    }
    
    .ambient-profile-page .ambient-nav {
        padding: 0.25rem;
        justify-content: center;
    }
    
    .ambient-profile-page .ambient-nav-item {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .profile-image img,
    .placeholder-image {
        width: 120px;
        height: 120px;
    }
    
    .profile-info h2 {
        font-size: 1.5rem;
    }
    
    .btn-edit {
        width: 100%;
        justify-content: center;
    }
}

/* === EDIÇÃO DE PERFIL DO AMBIENTE === */
@media (max-width: 991px) {
    .ambient-profile-edit-page .form-group.half {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .ambient-profile-edit-page .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ambient-profile-edit-page .action-buttons {
        width: 100%;
    }
    
    .ambient-profile-edit-page .back-button {
        width: 100%;
        justify-content: center;
    }
    
    .ambient-profile-edit-page .ambient-nav {
        padding: 0.25rem;
        justify-content: center;
    }
    
    .ambient-profile-edit-page .ambient-nav-item {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .edit-card {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel, 
    .btn-save {
        width: 100%;
        justify-content: center;
    }
    
    .formation-card {
        padding: 1rem;
    }
    
    .formation-details {
        grid-template-columns: 1fr;
    }
}

/* === MEMBROS DO AMBIENTE === */
@media screen and (max-width: 768px) {
    .ambient-members-page .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ambient-members-page .ambient-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .ambient-members-page .ambient-nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .members-list {
        grid-template-columns: 1fr;
    }
    
    .member-card {
        padding: 1.25rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        justify-content: center;
    }
}

/* === SOLICITAÇÕES DO AMBIENTE === */
@media screen and (max-width: 768px) {
    .ambient-solicitations-page .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ambient-solicitations-page .ambient-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .ambient-solicitations-page .ambient-nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .solicitation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .solicitation-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .accept-btn, .refuse-btn {
        padding: 0.5rem 1rem;
    }
}