/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

.astotel-logo {
    height: 90px;
    width: auto;
}

.logo-container h1 {
    font-size: 1.8rem;
    color: #00B5AD;
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
}

.search-container {
    flex: 1;
    max-width: 100%;
}

#searchBar {
    width: 100%;
    padding: 18px 30px;
    border: 3px solid #00B5AD;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    transition: all 0.3s ease;
    background: #f8fffe;
    box-shadow: 0 4px 12px rgba(0, 181, 173, 0.15);
    caret-color: #00B5AD;
    color: #000;
}

#searchBar:focus {
    outline: none;
    border-color: #00B5AD;
    box-shadow: 0 6px 20px rgba(0, 181, 173, 0.3);
    background: white;
    transform: translateY(-2px);
}

#searchBar::placeholder {
    color: #999;
    font-weight: 600;
}

/* Profile Navigation */
.profile-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 25px;
    background: #f8fffe;
    border-top: 1px solid #e0f5f4;
    flex-wrap: wrap;
}

.profile-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-weight: bold;
    text-transform: uppercase;
}

.profile-btn:hover {
    border-color: #00B5AD;
    color: #00B5AD;
}

.profile-btn.active {
    background: #00B5AD;
    color: white;
    border-color: transparent;
}

/* Place Navigation */
.place-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 25px;
    background: #fff8f0;
    border-top: 1px solid #ffe0c0;
    flex-wrap: wrap;
}

.place-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-weight: bold;
    text-transform: uppercase;
}

.place-btn:hover {
    border-color: #ff9800;
    color: #ff9800;
}

.place-btn.active {
    background: #ff9800;
    color: white;
    border-color: transparent;
}

/* Main Container */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 25px;
}

/* Category Sections */
.category {
    margin-bottom: 25px;
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
}

.category h2 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: white;
    background: #00B5AD;
    font-size: 1rem;
    margin: 0;
    padding: 10px 5px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
}

.category h2::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255, 255, 255, 0.3);
}

/* Tools Grid - 10 par ligne */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    padding: 15px;
    flex: 1;
}

/* Tool Card - Ultra compact */
.tool-card {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    min-height: 110px;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 181, 173, 0.2);
    border-color: #00B5AD;
}

.tool-card.keyboard-focused {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(0, 181, 173, 0.5);
    border-color: #00B5AD;
    outline: none;
}

.tool-card.hidden {
    display: none;
}

.tool-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    min-height: 0;
}

.tool-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    height: 60px;
}

.tool-card h3 {
    font-size: 0.65rem;
    color: #333;
    margin: 0;
    padding: 8px 6px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-card p {
    display: none; /* Masqué pour gain de place */
}

.tool-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

/* Favorites Star */
.favorite-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #00B5AD;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    z-index: 10;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.favorite-btn:hover {
    opacity: 1;
    background: #00B5AD;
    color: white;
    transform: scale(1.15);
}

.favorite-btn.active {
    opacity: 1;
    background: #00B5AD;
    color: #FFFFFF;
    border-color: #00B5AD;
}

/* Tutorial Button */
.tutorial-btn {
    background: #00B5AD;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 181, 173, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.tutorial-btn:hover {
    background: #009690;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 181, 173, 0.4);
}

.tutorial-btn span {
    line-height: 1;
}

/* Tutorial Overlay */
.tutorial-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
}

.tutorial-overlay.active {
    display: block;
    pointer-events: all;
}

.tutorial-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.tutorial-spotlight {
    position: absolute;
    border: 4px solid #00B5AD;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 181, 173, 1), inset 0 0 20px rgba(0, 181, 173, 0.2);
    z-index: 2;
    transition: all 0.4s ease;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.05);
}

.tutorial-modal {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.tutorial-modal.positioned {
    top: auto;
    left: auto;
    transform: none;
}

.tutorial-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #00B5AD;
}

.tutorial-skip-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tutorial-skip-btn:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}

.tutorial-body {
    padding: 25px;
}

.tutorial-body p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
}

.tutorial-body .tutorial-demo {
    margin-top: 15px;
    padding: 20px;
    background: #f8fffe;
    border-radius: 8px;
    border: 2px solid #00B5AD;
    text-align: center;
}

.tutorial-body .tutorial-demo-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.tutorial-body .tutorial-demo-typing {
    font-size: 2rem;
    font-family: monospace;
    font-weight: bold;
    color: #00B5AD;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.typing-letter-1, .typing-letter-2 {
    display: inline-block;
    transition: opacity 0.3s ease;
    min-width: 20px;
}

.typing-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #00B5AD;
}

.tutorial-body .tutorial-demo-hint {
    font-weight: 600;
    color: #00B5AD;
    font-size: 0.9rem;
    margin-top: 15px;
    font-style: italic;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes typingPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.tutorial-footer {
    padding: 20px 25px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-progress {
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}

.tutorial-btn-primary, .tutorial-btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.tutorial-btn-primary {
    background: #00B5AD;
    color: white;
}

.tutorial-btn-primary:hover {
    background: #009690;
}

.tutorial-btn-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.tutorial-btn-secondary:hover {
    background: #f5f5f5;
    color: #333;
}

/* Footer */
footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: #666;
    margin-top: 30px;
    border-top: 1px solid #e8e8e8;
    font-size: 0.85rem;
}

.footer-content p {
    margin: 3px 0;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.footer-content a:hover {
    text-decoration: underline;
}

.restore-defaults-link {
    color: #00B5AD !important;
    cursor: pointer;
}

.restore-defaults-link:hover {
    color: #009690 !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1600px) {
    .tools-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .header-top {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }

    .logo-container {
        min-width: auto;
    }

    .search-container {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .profile-nav, .place-nav {
        padding: 8px 15px;
        gap: 6px;
    }

    .profile-btn, .place-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 400px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
