/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Variables CSS */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #4facfe;
    --success-color: #43e97b;
    --error-color: #ff6b6b;
    --warning-color: #feca57;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --background-light: #ffffff;
    --background-card: rgba(255, 255, 255, 0.95);
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 50px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations globales */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Page de connexion */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--background-card);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-large);
    padding: 40px;
    box-shadow: var(--shadow-heavy);
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

.login-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--background-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error {
    border-color: var(--error-color);
    animation: shake 0.5s ease-in-out;
}

.btn-login {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.error-message {
    background: #ffe6e6;
    color: var(--error-color);
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid #ffcccc;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.error-message.shake {
    animation: shake 0.5s ease-in-out;
}

.success-message {
    background: #e6f9f0;
    color: var(--success-color);
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid #b3ebd1;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.forgot-password-link {
    text-align: center;
    margin-top: 15px;
}

.forgot-password-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.forgot-password-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Page Dashboard */
.dashboard-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.dashboard-header {
    background: var(--background-card);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.hub-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hub-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.hub-title {
    height: 65px;
    width: auto;
    object-fit: contain;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Bouton d'installation PWA */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.05s ease;
}

.btn-install:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: rgba(0,0,0,0.2);
}

.btn-install:active {
    transform: translateY(1px);
}

.user-info span {
    font-weight: 500;
    color: var(--text-primary);
}

.btn-logout {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.apps-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
}

.apps-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    justify-items: center;
}

.loading-apps {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

/* Bulles d'applications - Style Microsoft Store */
.app-bubble {
    position: relative;
    width: 300px;
    height: 280px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: var(--transition);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    background: white;
}

.app-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Partie haute - Icône + Dégradé */
.bubble-content-top {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.bubble-content-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.app-icon {
    font-size: 56px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.app-icon img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Partie basse - Infos sur fond blanc */
.bubble-content-bottom {
    width: 100%;
    height: 140px;
    background: white;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.app-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.app-rights {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.app-rights i {
    font-size: 11px;
    color: var(--primary-color);
}

.app-description {
    font-size: 13px;
    color: #777;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
}

.rights-label {
    font-weight: 600;
}

.bubble-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px) brightness(0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--border-radius-large);
    z-index: 10;
    cursor: pointer;
}

.bubble-overlay span {
    padding: 14px 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-bubble:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.app-bubble:hover .bubble-overlay {
    opacity: 1;
}

.app-bubble:hover .bubble-overlay span {
    transform: scale(1);
    opacity: 1;
}

.app-bubble.clicked {
    transform: translateY(-8px) scale(0.98);
}

.app-bubble.focused {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* État sans applications */
.no-apps {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-apps-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-apps h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.no-apps p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-main {
        padding: 30px 15px;
    }
    
    .apps-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .app-bubble {
        width: 100%;
        max-width: 350px;
        height: 260px;
    }
    
    .bubble-content-top {
        height: 120px;
    }
    
    .bubble-content-bottom {
        height: 140px;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .hub-branding {
        gap: 10px;
    }
    
    .hub-logo {
        height: 60px;
    }
    
    .hub-title {
        height: 50px;
    }
    
    .login-card {
        padding: 30px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .app-bubble {
        height: 240px;
    }
    
    .bubble-content-top {
        height: 100px;
    }
    
    .bubble-content-bottom {
        height: 140px;
        padding: 12px 16px;
    }
    
    .app-icon {
        font-size: 44px;
    }
    
    .app-icon img {
        width: 48px !important;
        height: 48px !important;
    }
    
    .app-name {
        font-size: 15px;
    }
    
    .app-description {
        font-size: 12px;
    }
    
    .user-info span {
        display: none;
    }
}

/* Système d'annonces */
.annonces-bandeau {
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 999;
    height: 40px;
    overflow: hidden;
    position: relative;
}

.bandeau-content {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 50px 0 0;
    position: relative;
}

.bandeau-content.urgente {
    animation: pulseUrgent 2s infinite;
}

.bandeau-text {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    animation: scroll-left 25s linear infinite;
    padding-left: 100%;
}

.bandeau-text strong {
    font-size: 14px;
    font-weight: 600;
}

.bandeau-text span {
    font-size: 14px;
    opacity: 0.95;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.bandeau-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.25);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: all 0.2s;
    z-index: 10;
}

.bandeau-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Popup annonces */
.annonce-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.annonce-popup-overlay.visible {
    opacity: 1;
}

.annonce-popup {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.annonce-popup-overlay.visible .annonce-popup {
    transform: scale(1);
}

.popup-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-content {
    padding: 30px;
    text-align: center;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.1);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.popup-close:hover {
    background: rgba(0,0,0,0.2);
}

.popup-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.popup-content h2 {
    font-size: 24px;
    margin: 0 0 15px 0;
}

.popup-content p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 25px 0;
    opacity: 0.95;
}

.btn-popup-ok {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: inherit;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-popup-ok:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes pulseUrgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Responsive annonces */
@media (max-width: 768px) {
    .bandeau-content {
        padding: 12px 15px;
    }
    
    .bandeau-text strong {
        font-size: 14px;
    }
    
    .bandeau-text span {
        font-size: 13px;
    }
    
    .annonce-popup {
        width: 95%;
    }
    
    .popup-content {
        padding: 25px 20px;
    }
    
    .popup-content h2 {
        font-size: 20px;
    }
    
    .popup-content p {
        font-size: 14px;
    }
}

/* Améliorations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 