/* ==============================================
   HOME PAGE STYLES - Word Market
   Mobilné a desktop štýly pre domovskú stránku
   ============================================== */

/* ==============================================
   ZÁKLADNÉ ŠTÝLY JAZYKOVÝ MODUL
   ============================================== */

/* Jazykový prepínač na home stránke */
.home-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.home-auth-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.home-auth-section .language-switcher {
    margin: 0;
}

.home-auth-section .language-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
}

.home-auth-section .language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.home-auth-section .language-options {
    right: 0;
    left: auto;
    top: calc(100% + 8px);
    min-width: 180px;
}

/* ==============================================
   ŠTÝLY PRE VLAJKY
   ============================================== */

.home-flag-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.home-flag-image {
    width: 20px;
    height: 14px;
    border: 1px solid #ccc;
    border-radius: 2px;
    object-fit: cover;
}

.home-flag-code {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* ==============================================
   ZÁKLADNÉ ŠTÝLY HOME STRÁNKY
   ============================================== */

.home-header {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.home-logo {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.home-auth-buttons {
    display: flex;
    gap: 15px;
}

.home-auth-buttons a,
.home-auth-buttons button {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-login {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

.btn-register {
    background: white;
    color: #1a73e8;
}

.btn-login:hover {
    background: white;
    color: #1a73e8;
}

.btn-register:hover {
    background: rgba(255,255,255,0.9);
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

.btn-profile {
    background: white;
    color: #1a73e8;
}

.home-main {
    background: #f8f9fa;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.home-container {
    max-width: 1200px;
    margin: 0 auto;
}

.home-hero {
    text-align: center;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.home-hero-content {
    flex: 1;
    max-width: 600px;
}

.home-hero h1 {
    font-size: 48px;
    color: #1a73e8;
    margin-bottom: 20px;
    font-weight: 700;
}

.home-hero p {
    font-size: 20px;
    color: #5f6368;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Štýly pre váhy v hero sekcii */
.hero-scales {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-scales img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.hero-scales:hover img {
    transform: scale(1.05);
}

/* ==============================================
   VYHĽADÁVACIA SEKCIA
   ============================================== */

.home-search-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.home-search-title {
    text-align: center;
    margin-bottom: 30px;
}

.home-search-title h2 {
    color: #1a73e8;
    font-size: 28px;
    margin-bottom: 10px;
}

.home-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.home-search-wrapper {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-family: inherit;
}

.search-visual-text {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    padding: 15px 25px;
    color: transparent;
    pointer-events: none;
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    font-size: 16px;
    font-family: inherit;
}

.home-search-input {
    position: absolute;
    top: 0;
    left: 0;
    padding: 15px 25px;
    width: 100%;
    background: transparent;
    border: none;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    z-index: 2;
    box-sizing: border-box;
}

.wm-index {
    color: #1a73e8;
    font-weight: bold;
    font-family: monospace;
    margin-left: -8px;
    font-size: 0.9em;
    vertical-align: super;
}

.wm-index-suffix {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #1a73e8;
    font-weight: bold;
    font-size: 16px;
    pointer-events: none;
    user-select: none;
    background: white;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    font-family: monospace;
}

.home-search-wrapper:focus-within .wm-index-suffix {
    color: #1557b0;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.home-search-wrapper:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.home-search-button {
    padding: 15px 30px;
    background: #1a73e8;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.home-search-button:hover {
    background: #1557b0;
}

/* ==============================================
   USER INFO
   ============================================== */

.user-info-home {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.user-credit {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==============================================
   ŠTATISTIKY
   ============================================== */

.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.stats-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.stats-card-icon {
    font-size: 24px;
    color: #1a73e8;
}

.stats-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 12px;
}

.stats-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
}

.stats-table tr:hover {
    background: #f8f9fa;
}

.clickable-word {
    color: #1a73e8;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.clickable-word:hover {
    background-color: #e3f2fd;
    font-weight: 600;
    text-decoration: underline;
}

/* ==============================================
   FEATURES SEKCIA
   ============================================== */

.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.home-feature {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.home-feature:hover {
    transform: translateY(-5px);
}

.home-feature-icon {
    font-size: 48px;
    color: #1a73e8;
    margin-bottom: 20px;
}

.home-feature h3 {
    color: #1a73e8;
    margin-bottom: 15px;
    font-size: 24px;
}

.home-feature p {
    color: #5f6368;
    line-height: 1.6;
}

.feature-scales {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-scales img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.feature-scales:hover img {
    transform: scale(1.1);
}

/* ==============================================
   FOOTER
   ============================================== */

.home-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
}

/* ==============================================
   LOGIN MODAL
   ============================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    animation: slideInModal 0.4s ease-out;
    margin: 20px;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 30px 30px 20px;
    text-align: center;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-logo {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-subtitle {
    opacity: 0.9;
    font-size: 16px;
}

.modal-body {
    padding: 40px 30px;
}

.modal-title {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    background: white;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.btn-modal {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(26, 115, 232, 0.3);
}

.error-messages {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #cc0000;
    font-size: 14px;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.register-link a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* ==============================================
   USER WORDS MODAL
   ============================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
}

.user-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.user-word-tile {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-word-tile:hover {
    background: #e3f2fd;
    border-color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,115,232,0.15);
}

.word-text {
    font-size: 16px;
    font-weight: bold;
    color: #1a73e8;
    margin-bottom: 8px;
    word-break: break-word;
}

.word-price {
    font-size: 14px;
    color: #28a745;
    font-weight: 500;
}

/* ==============================================
   MOBILNÉ OPTIMALIZÁCIE
   ============================================== */

@media (max-width: 768px) {
    /* Jazykový modul */
    .home-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .home-auth-section {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }
    
    .home-auth-buttons {
        order: 2;
    }
    
    .language-switcher {
        order: 1;
    }
    
    .user-info-home {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Vlajky */
    .home-flag-image {
        width: 18px;
        height: 12px;
    }
    
    .home-flag-code {
        font-size: 10px;
    }

    /* Hlavná sekcia - odstránenie bieleho priestoru */
    .home-main {
        padding: 5px 3px !important;
    }
    
    .home-container {
        padding: 0 !important;
    }

    /* Hero sekcia */
    .home-hero {
        flex-direction: column;
        gap: 30px;
    }
    
    .home-hero h1 {
        font-size: 36px;
    }
    
    .home-hero p {
        font-size: 18px;
    }
    
    .hero-scales {
        width: 120px;
        height: 120px;
    }

    /* Vyhľadávanie - oprava poľa */
    .search-visual-text {
        display: none !important;
    }
    
    .home-search-input {
        background: white !important;
        color: #333 !important;
    }
    
    .home-search-input::placeholder {
        color: #999 !important;
        opacity: 1 !important;
    }
    
    .home-search-wrapper {
        flex-direction: row !important;
        border-radius: 25px !important;
    }
    
    .search-input-container {
        background: white !important;
    }
    
    .home-search-button {
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 0 25px 25px 0 !important;
    }

    /* Štatistiky */
    .home-stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Features */
    .feature-scales {
        width: 100px;
        height: 100px;
    }

    /* Modály */
    .modal-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .modal-header {
        border-radius: 15px 15px 0 0;
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .user-words-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    /* Skryť medaile vedľa slova */
    .search-result-word::before,
    .search-result-word::after {
        display: none !important;
        content: none !important;
    }
    
    .search-result-header .tier-symbol,
    .search-result-header .medal-icon,
    .search-result-word .medal {
        display: none !important;
    }

    /* Oprava tlačidiel v search results */
    .search-result-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 15px 10px !important;
        width: 100% !important;
    }
    
    .search-result-actions .golden-button,
    .search-result-actions button {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px 20px !important;
        box-sizing: border-box !important;
    }
    
    .golden-button i {
        margin-right: 8px !important;
    }
}