
* {
    box-sizing: border-box; 
}

body {
    font-family: 'Arial', 'Roboto', 'Helvetica', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7fb;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; 
    width: 100%;
    max-width: 100vw;
    line-height: 1.6;
}

.header {
            background-color: white;
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
            top: 0;
    margin-bottom: 10px;
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            height: 80px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 24px;
            font-weight: bold;
            text-decoration: none;
            color: #333;
        }

        .nav-links {
            display: flex;
            align-items: center;
        }

        .nav-links a {
            text-decoration: none;
            color: #333;
            padding: 10px;
            transition: color 0.3s ease;
        }

        .nav-links a:hover {
            color: #FF9900;
        }

.hamburger {
    display: none;
    cursor: pointer;
    padding: 10px;
    width: 30px;
    height: 30px;
    position: relative;
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    -webkit-tap-highlight-color: transparent; 
}

.hamburger:hover,
.hamburger:active,
.hamburger:focus {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
}

.hamburger-lines {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #888;
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger-lines::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #888;
    top: -6px;
    left: 0;
    transition: transform 0.3s ease;
}

.hamburger-lines::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #888;
    bottom: -6px;
    left: 0;
    transition: transform 0.3s ease;
}

.hamburger.active .hamburger-lines {
    background-color: transparent;
}

.hamburger.active .hamburger-lines::before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger.active .hamburger-lines::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    width: 100%;
    flex-grow: 1;
    align-items: flex-start; 
}


.sidebar {
    flex: 0 0 300px;
    background-color: #ffffff;
    color: #1f2937;        
    padding: 20px;
    border-radius: 8px;
    margin-left: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
}

.sidebar h3 {
    margin-top: 0;
    font-size: 18px;
    text-align: center;
    border-bottom: 2px solid #e5e7eb;  
    padding-bottom: 10px;
    color: #111827;  
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #4b5563;         
    font-weight: 500;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar ul li a:hover {
    background-color: #f3f4f6; 
    color: #111827;     
}

.content {
    flex: 1;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

h1 {
    margin-top: 0;
    font-size: 26px;
    margin-bottom: 20px;
    color: #1f2937;
}

label, select, button {
    font-size: 18px;
    margin-bottom: 15px;
    display: block;
}

select, button {
    padding: 10px;
    width: 100%;
    max-width: 100%; 
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #333;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


button {
    background-color: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px 15px;
    font-size: 16px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.5;
    white-space: nowrap;
}

button:hover {
    background-color: #2563eb;
}

#button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap; 
}

#info {
    margin-top: 40px;
}

#info h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #1f2937;
}

#info h3 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #333;
}

#info p {
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 15px;
    color: #4b5563;
}

#info ol, #info ul {
    padding-left: 0;
    margin-left: 0;  
    list-style-position: inside; 
}

#info ol li, #info ul li {
    padding-left: 0; 
    margin-left: 0;  
    color: #4b5563;
}

.language-version {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.language-version li {
    flex: 0 0 calc(20% - 10px);
    max-width: calc(20% - 10px);
}

.language-version li a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    transition: all 0.3s ease;
    height: 60px; 
    width: 100%;
    box-sizing: border-box;
}

.language-version li a:hover {
    background-color: #3b82f6;
    color: white;
}

.footer {
    text-align: center;
    padding: 15px;
}

.footer p {
    padding: 3px;
    font-size: 0.8em;
    color: #4b5563;
}

.footer p a {
    color: #4b5563;
    text-decoration: none;
    padding: 10px; 
}

#common-link {
            margin-top: 30px;
        }

#common-link h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #1f2937;
}

        #common-link ul {
            list-style-type: none;
            padding: 0;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        #common-link li {
            flex: 1 0 calc(33.333% - 10px);
            min-width: 100px;
        }
        #common-link a {
            display: block;
            padding: 10px;
            background-color: #f0f0f0;
            border-radius: 5px;
            text-align: center;
            text-decoration: none;
            color: #333;
            transition: background-color 0.3s ease;
        }
        #common-link a:hover {
            background-color: #e0e0e0;
        }

.input-group {
      margin-top: 20px;
    }

    .input-group label {
      display: block;
      margin-top: 10px;
      margin-bottom: 5px;
    }

    .form-control {
      width: 100%;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 4px;
      margin-bottom: 10px;
      font-size: 1rem;
    }

    #result {
      margin-top: 20px;
      padding: 20px;
      background: #f8f9fa;
      border-radius: 4px;
      display: none;
      font-size: 1.5rem;
      font-weight: bold;
      color: #3b82f6;
    }


.input-group textarea {
            width: 100%;
            min-height: 150px;
            padding: 10px;
            margin-bottom: 10px;
            margin-top: 5px;
            border-radius: 5px;
            border: 1px solid #d1d5db;
            font-size: 16px;
            color: #333;
            resize: vertical;
      }
    .gift-result {
      text-align: center;
      margin-top: 10px;
    }
    .gift-image-container {
      display: flex;
      justify-content: center;
      margin-bottom: 10px;
    }
    .gift-image {
      max-width: 300px;
      max-height: 300px;
      object-fit: contain;
    }
    .gift-button-container {
      display: flex;
      justify-content: center;
    }
    .amazon-button {
      display: inline-block;
      background-color: #f3d078;
      border-color: #f2c200 #f0c14b #f0c14b #f2c200;
      border-style: solid;
      border-width: 1px;
      color: #111;
      padding: 10px 20px;
      margin-bottom: 50px;
      text-decoration: none;
      border-radius: 5px;
      font-weight: bold;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }
    .amazon-button:hover {
      background-color: #f0c14b;
    }
    .loading-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin-top: 20px;
    }
    
    .loading-spinner {
      border: 4px solid #f3f3f3;
      border-top: 4px solid #3498db;
      border-radius: 50%;
      width: 50px;
      height: 50px;
      animation: spin 1s linear infinite;
      margin-bottom: 15px;
    }
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    /* Button disabled state */
    button:disabled {
      background-color: #cccccc;
      cursor: not-allowed;
    }


.gift-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        
        .gift-table th, .gift-table td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        
        .gift-table th {
            background-color: #f5f5f5;
        }
        
        .gift-table-image {
            width: 150px;
            height: 150px;
            object-fit: contain;
            transition: transform 0.2s;
        }
        
        .gift-table-image:hover {
            transform: scale(1.05);
        }
        
        .table-amazon-button {
            display: inline-block;
            padding: 8px 15px;
            background-color: #FF9900;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            transition: background-color 0.2s;
            text-align: center;
        }
        
        .table-amazon-button:hover {
            background-color: #FF8800;
        }

.gift-title {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em; 
    margin-bottom: 10px;
    text-overflow: ellipsis;
}

        
        .gift-title:hover {
            color: #FF9900;
        }
        
        .number-cell {
            font-weight: bold;
            color: #666;
            width: 50px;
        }
        
        .image-cell {
            width: 170px;
        }
        
        .button-cell {
            width: 150px;
        }

@media (max-width: 900px) {

    .header {
        margin-bottom: 0;
    }

            .logo {
            font-size: 20px;
        }

.nav-links {
                display: none;
                position: absolute;
                top: 60px;
                right: 0;
                background-color: white;
                width: 200px;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                padding: 20px;
            }

            .nav-links.active {
                display: block;
            }

            .nav-links a {
                display: block;
                padding: 10px;
            }

.hamburger {
        display: block;
    }
    
    .container {
        flex-direction: column;
        padding: 15px; 
        margin: 0; 
    }

    .sidebar {
        flex: 0 0 auto;
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
        order: 1;
        padding: 15px; 
    }

    .content {
        order: 0;
        margin-bottom: 20px;
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }

    h1 {
        font-size: 20px; 
        margin-bottom: 15px;
    }

    .sidebar h3 {
        font-size: 16px; 
    }

    #info h2 {
    font-size: 18px;
}

#info h3 {
    font-size: 1em;
}

    label, select, button {
        font-size: 16px; 
    }

    select, button {
        padding: 8px; 
    }

    #result-name {
        font-size: 28px; 
    }

    #common-link h2 {
    font-size: 18px;
}
        #common-link li {
                flex: 1 0 calc(50% - 10px);
            }
}


@media (max-width: 768px) {

 .gift-table thead {
                display: none; 
            }

            .gift-table, 
            .gift-table tbody, 
            .gift-table tr, 
            .gift-table td {
                display: block;
                width: 100%;
                text-align: center;
            }

            .gift-table tr {
                margin-bottom: 30px;
                border: 1px solid #ddd;
                border-radius: 8px;
                padding: 15px;
                box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }

            .gift-table td {
                border: none;
                padding: 8px;
            }

            .number-cell {
                font-size: 1.2em;
                color: #FF9900;
                margin-bottom: 10px;
            }

            .image-cell {
                margin: 0 auto;
            }

            .gift-table-image {
                width: 200px;
                height: 200px;
                margin: 0 auto;
            }


    .gift-title {
        font-size: 1.1em;
        margin: 15px 0;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

            .button-cell {
                margin-top: 15px;
            }

            .table-amazon-button {
                width: 100%;
                max-width: 200px;
                margin: 0 auto;
                padding: 12px 20px;
            }

            .number-cell::before {
                content: "Gift #";
            }
  
}

        @media (max-width: 480px) {
            .gift-table-image {
                width: 150px;
                height: 150px;
            }

            .gift-table tr {
                padding: 10px;
            }


    .gift-title {
        font-size: 1em;
        max-width: 250px;
    }

        }
