/* ========== RESET & GLOBAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    background: linear-gradient(to right, #fefefe 0%, #f9f1ea 100%);
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 0;
    overflow-y: auto;
    position: fixed;
    width: 100%;
    height: 100vh;
}

/* ========== TOP MENU ========== */
.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background-image: url('https://cctvapp.net/app/asset/menu_bgr1.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.logo {
    height: 40px;
    cursor: pointer;
}

.auth-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.auth-link {
    color: #455a64;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: #455a64;
}

.auth-link i {
    font-size: 14px;
    color: #455a64;
    transition: color 0.3s ease;
}

.auth-link:hover i {
    color: #455a64;
}

/* ========== MAIN CONTAINER ========== */
.container {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 5px 10px 0 10px;
    width: calc(100% - 20px);
    height: calc(100vh - 60px - 70px - env(safe-area-inset-bottom));
    padding: 20px;
    overflow-y: auto;
}

/* ========== TOOL SECTION ========== */
.tool-section {
    margin-bottom: 25px;
}

.section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    position: relative;
}

.section-title h2 {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.section-title p {
    color: #90a4ae;
    font-size: 10px;
    font-weight: 400;
}

/* ========== TOOL GRID ========== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ========== TOOL CARD ========== */
.tool-card {
    background: white;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: #2d3748;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.tool-card.no-hover {
    pointer-events: none;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ff9800 0%, #ef6c00 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.tool-card:hover, .tool-card.active {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(220, 20, 60, 0.2);
    border-color: #ff9700;
}

.tool-card:hover::before, .tool-card.active::before {
    opacity: 0.05;
}

.tool-card:hover .tool-card-icon, .tool-card.active .tool-card-icon {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tool-card-icon {
    width: 28px;
    height: 28px;
    margin: 0 auto 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.tool-card-icon i {
    font-size: 17px;
    color: white;
}

.tool-card-content {
    position: relative;
    z-index: 1;
}

.tool-card-title {
    font-size: 9px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-card-title, .tool-card.active .tool-card-title {
    color: #ff9700;
}

.tool-card-desc {
    font-size: 9px;
    color: #fb8c00;
    line-height: 1.3;
}

.vip-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff9700;
    color: white;
    font-size: 8px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 2;
}

/* ========== TOOL CARD GRADIENTS ========== */
.tool-section:nth-child(1) .tool-grid .tool-card:nth-child(1) .tool-card-icon {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}
.tool-section:nth-child(1) .tool-grid .tool-card:nth-child(2) .tool-card-icon {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}
.tool-section:nth-child(1) .tool-grid .tool-card:nth-child(3) .tool-card-icon {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}
.tool-section:nth-child(1) .tool-grid .tool-card:nth-child(4) .tool-card-icon {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.tool-section:nth-child(2) .tool-grid .tool-card:nth-child(1) .tool-card-icon {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}
.tool-section:nth-child(2) .tool-grid .tool-card:nth-child(2) .tool-card-icon {
    background: linear-gradient(135deg, #009688 0%, #00796b 100%);
}
.tool-section:nth-child(2) .tool-grid .tool-card:nth-child(3) .tool-card-icon {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
}
.tool-section:nth-child(2) .tool-grid .tool-card:nth-child(4) .tool-card-icon {
    background: linear-gradient(135deg, #ffeb3b 0%, #fbc02d 100%);
}

.tool-section:nth-child(3) .tool-grid .tool-card:nth-child(1) .tool-card-icon {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}
.tool-section:nth-child(3) .tool-grid .tool-card:nth-child(2) .tool-card-icon {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}
.tool-section:nth-child(3) .tool-grid .tool-card:nth-child(3) .tool-card-icon {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}
.tool-section:nth-child(3) .tool-grid .tool-card:nth-child(4) .tool-card-icon {
    background: linear-gradient(135deg, #ff9800 0%, #ef6c00 100%);
}

.tool-section:nth-child(4) .tool-grid .tool-card:nth-child(1) .tool-card-icon {
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
}
.tool-section:nth-child(4) .tool-grid .tool-card:nth-child(2) .tool-card-icon {
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
}
.tool-section:nth-child(4) .tool-grid .tool-card:nth-child(3) .tool-card-icon {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
}
.tool-section:nth-child(4) .tool-grid .tool-card:nth-child(4) .tool-card-icon {
    background: linear-gradient(135deg, #673ab7 0%, #512da8 100%);
}

/* ========== BOTTOM MENU ========== */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: auto;
}

.menu-item {
    text-decoration: none;
    color: #546e7a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 11px;
}

.menu-item i {
    font-size: 16px;
}

.menu-item.active {
    color: #ff9700;
    font-weight: bold;
}

/* ========== MODALS ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 350px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 13px;
    font-weight: 600;
}

.close-btn {
    background: #f7fafc;
    border: none;
    font-size: 18px;
    color: #718096;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #edf2f7;
    color: #2d3748;
    transform: rotate(90deg);
}

/* ========== FORM GROUPS ========== */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    color: #2d3748;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #ff9700;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 151, 0, 0.1);
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #718096;
    font-size: 16px;
}

.password-toggle:hover {
    color: #ff9700;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.remember-me label {
    font-size: 12px;
    color: #2d3748;
    cursor: pointer;
}

/* ========== BUTTONS ========== */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(251, 140, 0, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 140, 0, 0.5);
}

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

.modal-links {
    text-align: center;
    margin-top: 15px;
    font-size: 11px;
}

.modal-links a {
    color: #ff9700;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-links a:hover {
    text-decoration: underline;
    color: #ef6c00;
}

/* ========== MESSAGES ========== */
.error-message {
    color: #f56565;
    font-size: 11px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(245, 101, 101, 0.1);
    border-radius: 6px;
    display: none;
}

.success-message {
    color: #48bb78;
    font-size: 11px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 6px;
    display: none;
}

/* ========== POPUPS ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2999;
    display: none;
    backdrop-filter: blur(3px);
}

.popup-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 3000;
    display: none;
    text-align: center;
    animation: popupSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 280px;
    max-width: 90%;
}

.success-popup.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes popupSlideIn {
    from {
        transform: translate(-50%, -70%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.success-popup i {
    font-size: 60px;
    color: #48bb78;
    margin-bottom: 15px;
    animation: checkAnimation 0.6s ease-in-out;
}

.success-popup .error-icon {
    color: #f56565;
}

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

.success-popup h3 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.success-popup p {
    color: #718096;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
}

.install-modal-content {
    font-size: 11px;
    line-height: 1.5;
}

.install-modal-content h3 {
    font-size: 13px;
    margin-bottom: 10px;
    color: #2d3748;
}

.install-modal-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.install-modal-content li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.install-modal-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff9700;
    font-size: 14px;
}

.confirm-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 3000;
    display: none;
    text-align: center;
    animation: popupSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 280px;
    max-width: 90%;
}

.confirm-popup.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.confirm-popup i {
    font-size: 60px;
    color: #ff9700;
    margin-bottom: 15px;
    animation: checkAnimation 0.6s ease-in-out;
}

.confirm-popup h3 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.confirm-popup p {
    color: #718096;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn, .cancel-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(251, 140, 0, 0.4);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 140, 0, 0.5);
}

.cancel-btn {
    background: #f7fafc;
    color: #2d3748;
    border: 2px solid #e2e8f0;
}

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .tool-section {
        margin-bottom: 20px;
    }
    .modal-content {
        padding: 20px;
        max-width: 300px;
    }
}

/* ========== NOTIFICATION ICON - KHÔNG BỊ GHI ĐÈ ========== */
.notification-icon {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 18px;
    color: #455a64;
    transition: all 0.3s ease;
    text-decoration: none;
}

.notification-icon:hover {
    color: #ff9700 !important;
    transform: scale(1.1) !important;
}

.notification-icon i {
    font-size: 18px;
    color: #455a64;
    transition: color 0.3s ease;
}

.notification-icon:hover i {
    color: #ff9700 !important;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff5252;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    z-index: 1;
}

/* Ngăn .auth-link ghi đè lên .notification-icon */
.notification-icon.auth-link:hover,
.notification-icon.auth-link:hover i {
    color: #ff9700 !important;
}


