/**
 * Index/Home Page Specific Styles
 */

/* ========================================
   Home Page Layout
   ======================================== */
.home-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

/* ========================================
   Logo Container
   ======================================== */
.logo-container {
    position: absolute;
    top: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
    animation: fadeIn 0.8s ease;
}

.main-logo {
    height: 60px;
    width: auto;
    transition: transform var(--transition-base);
}

.main-logo:hover {
    transform: scale(1.02);
}

/* ========================================
   Welcome Box
   ======================================== */
.welcome-box,
.login-box {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
                0 0 1px rgba(0, 0, 0, 0.1);
    padding: 48px;
    max-width: 1200px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.5s ease;
    backdrop-filter: blur(20px);
    margin-top: 20px;
}

.welcome-box .logo,
.login-box .logo {
    height: 80px;
    width: auto;
    margin-bottom: var(--spacing-lg);
    filter: brightness(1.1) drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
}

.welcome-box h1,
.login-box h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1f2e;
    margin-bottom: 12px;
    letter-spacing: -0.8px;
}

.welcome-box p,
.login-box p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 40px;
    font-weight: 400;
}

.subtitle {
    font-weight: 400;
    letter-spacing: 0.2px;
    color: #64748b;
}

/* ========================================
   Tool Cards Grid
   ======================================== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.tool-card {
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tool-card:hover {
    background: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-gradient);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
}

.tool-card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.tool-card-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* ========================================
   Tool Categories
   ======================================== */
.tool-category {
    margin-bottom: var(--spacing-xxl);
}

.tool-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 20px;
    text-align: left;
    padding-bottom: 0;
    border-bottom: none;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ========================================
   Tool Links Grid
   ======================================== */
.tool-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.tool-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    text-align: left;
    color: #1e293b;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tool-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #3b82f6;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    margin-bottom: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Category-specific icon colors */
.tool-icon-wrapper.translator {
    background: #f0fdf4;
}

.tool-icon-wrapper.bargainfox {
    background: #fef2f2;
}

.tool-icon-wrapper.other {
    background: #eff6ff;
}

.tool-icon {
    font-size: 20px;
    display: block;
    color: #64748b;
    filter: none;
}

.tool-icon-wrapper.translator .tool-icon {
    color: #22c55e;
}

.tool-icon-wrapper.bargainfox .tool-icon {
    color: #ef4444;
}

.tool-icon-wrapper.other .tool-icon {
    color: #3b82f6;
}

.tool-content {
    flex: 1;
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.tool-description {
    font-size: 13px;
    color: #64748b;
    display: block;
    line-height: 1.5;
}

.tool-link:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.tool-link:hover::before {
    transform: scaleY(0);
}

/* ========================================
   Authentication Message
   ======================================== */
#authMessage {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-left: 4px solid #ffa726;
    color: var(--gray-800);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 12px;
    margin-top: var(--spacing-xl);
    text-align: left;
    box-shadow: 0 2px 8px rgba(255, 167, 38, 0.15);
}

#authMessage strong {
    font-weight: var(--font-weight-semibold);
    color: #f57c00;
}

#authMessage a {
    color: #667eea;
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    border-bottom: 1px solid #667eea;
}

#authMessage a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* ========================================
   User Info Display
   ======================================== */
.user-info {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.user-info span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

.user-info #username {
    color: #ffffff;
    font-weight: 600;
}

#logoutBtn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

#logoutBtn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: none;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .home-body {
        padding: var(--spacing-md);
    }
    
    .logo-container {
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    
    .main-logo {
        height: 50px;
    }
    
    .welcome-box h1,
    .login-box h1 {
        font-size: 32px;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-links {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .tool-link {
        padding: 20px;
    }
    
    .tool-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .tool-icon {
        font-size: 28px;
    }
    
    .user-info {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 11px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .user-info span {
        font-size: 11px;
    }

    .user-info #userWelcome {
        flex: 0 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .user-info .btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    #settingsBtn, #logoutBtn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .version-info {
        bottom: 10px;
        padding: 4px 12px;
    }

    .version-info span {
        font-size: 10px;
    }
}

/* ========================================
   Version Info Display
   ======================================== */
.version-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 16px;
    border-radius: 6px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    z-index: 50;
}

.version-info span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

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

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

@media (max-width: 480px) {
    .home-body {
        padding: 0;
    }
    
    .welcome-box,
    .login-box {
        padding: var(--spacing-lg);
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .welcome-box h1,
    .login-box h1 {
        font-size: 24px;
    }
    
    .welcome-box p,
    .login-box p {
        font-size: var(--font-size-base);
    }
    
    .tool-link {
        padding: var(--spacing-md);
    }
    
    .tool-icon {
        font-size: 32px;
    }
    
    .tool-name {
        font-size: var(--font-size-base);
    }
}