@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: #fff;
    color: #202124;
}

.hidden {
    display: none !important;
}

/* --- หน้าหลัก --- */
#main-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90vh; /* ลดความสูงเล็กน้อย */
}
.google-logo { width: 272px; height: 92px; margin-bottom: 28px; }
.search-container { display: flex; align-items: center; border: 1px solid #dfe1e5; border-radius: 24px; width: 100%; max-width: 580px; padding: 0 14px; transition: box-shadow 0.2s; }
.search-container:hover { box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28); border-color: rgba(223, 225, 229, 0); }
.search-icon { fill: #9aa0a6; height: 20px; width: 20px; margin-right: 13px; }
#search-input { flex-grow: 1; border: none; outline: none; background-color: transparent; padding: 10px 0; font-size: 16px; }
.search-buttons { margin-top: 28px; }
.search-buttons button { background-color: #f8f9fa; border: 1px solid #f8f9fa; border-radius: 4px; color: #3c4043; font-size: 14px; margin: 0 4px; padding: 0 16px; height: 36px; cursor: pointer; }
.search-buttons button:hover { box-shadow: 0 1px 1px rgba(0,0,0,0.1); border: 1px solid #dadce0; }

/* --- หน้ากำลังโหลด --- */
#loading-screen { display: flex; justify-content: center; align-items: center; height: 100vh; flex-direction: column; font-size: 18px; color: #5f6368; }
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #4285f4; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* --- (ใหม่) หน้าผลลัพธ์ --- */
#search-results-container {
    display: flex;
    flex-direction: column;
}

/* Header Bar */
.results-header-bar {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #ebebeb;
}
.results-logo { width: 92px; height: 30px; margin-right: 40px; }
.header-search-container {
    display: flex;
    align-items: center;
    border: 1px solid #dfe1e5;
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16);
    border-radius: 24px;
    padding: 0 15px;
    flex-grow: 1;
    max-width: 690px;
}
#header-search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 10px 0;
    background: transparent;
}
.header-search-icons { display: flex; align-items: center; color: #70757a; }
.header-search-icons span { padding: 0 8px; cursor: pointer; }
.header-search-icons .icon { fill: #4285f4; height: 24px; width: 24px; cursor: pointer; }

/* Nav Tabs */
.results-nav {
    display: flex;
    padding-left: 165px; /* จัดให้ตรงกับเนื้อหา */
    border-bottom: 1px solid #ebebeb;
}
.results-nav a {
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    padding: 16px 12px;
}
.results-nav a.active {
    color: #1a73e8;
    border-bottom: 3px solid #1a73e8;
    font-weight: 500;
}

/* Content Area */
.results-content {
    padding-left: 165px; /* จัดให้ตรงกับ Nav */
    padding-top: 16px;
    max-width: 600px;
}
.results-count { font-size: 14px; color: #70757a; margin-bottom: 20px; }
.search-result-item { margin-bottom: 24px; }
.result-title { font-size: 20px; color: #1a0dab; text-decoration: none; font-weight: 400; }
.result-title:hover { text-decoration: underline; }
.result-url { display: block; font-size: 14px; color: #202124; margin-top: 2px; }
.result-snippet { font-size: 14px; color: #4d5156; line-height: 1.5; margin-top: 4px; }
b { font-weight: normal; color: #202124; }

/* No Results Message */
.no-results { margin-top: 20px; font-size: 14px; }
.no-results p { margin: 8px 0; }
.no-results ul { list-style-type: disc; padding-left: 20px; color: #5f6368; }
.no-results b { font-weight: bold; }