/* Doodle - complete style.css
   Restores the Google-like clean layout and includes Accounts + DMAIL styles.
*/

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #222;
    background: #fff;
}

a {
    color: #1a0dab;
}

a:hover {
    text-decoration: underline;
}

/* -------------------------
   Top buttons / user area
------------------------- */

.top-right {
    position: absolute;
    top: 22px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.signin-button {
    display: inline-block;
    background: #4285f4;
    color: #fff !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    padding: 8px 15px;
    border-radius: 2px;
    border: 1px solid #4285f4;
}

.signin-button:hover {
    background: #3367d6;
    text-decoration: none;
}

.mail-link,
.plain-top-link {
    color: #1a0dab;
    text-decoration: none;
    font-size: 13px;
}

.mail-link:hover,
.plain-top-link:hover {
    text-decoration: underline;
}

.avatar-link img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid #d6d6d6;
    vertical-align: middle;
}

/* -------------------------
   Home page
------------------------- */

.home-page {
    min-height: 100vh;
    position: relative;
}

.home-center {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding-top: 185px;
}

.home-logo {
    display: block;
    width: 270px;
    height: auto;
    margin: 0 auto 34px auto;
}

.home-search input[type="text"] {
    display: block;
    width: 586px;
    height: 40px;
    margin: 0 auto;
    padding: 5px 8px;
    border: 1px solid #d9d9d9;
    border-top-color: #c0c0c0;
    font-size: 16px;
    outline: none;
}

.home-search input[type="text"]:focus {
    border-color: #4285f4;
}

.home-buttons {
    margin-top: 32px;
    text-align: center;
}

.home-buttons button {
    height: 36px;
    line-height: 27px;
    margin: 0 4px;
    padding: 0 16px;
    background: #f2f2f2;
    border: 1px solid #f2f2f2;
    border-radius: 2px;
    color: #444;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.home-buttons button:hover {
    border: 1px solid #c6c6c6;
    color: #222;
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
}

/* -------------------------
   Search results page
------------------------- */

.results-page {
    background: #fff;
}

.results-header {
    height: 70px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 24px;
}

.results-logo-link {
    display: block;
    flex: 0 0 auto;
}

.results-logo {
    display: block;
    width: 112px;
    height: auto;
}

.results-search-form {
    display: flex;
    align-items: center;
    width: 690px;
    max-width: 690px;
}

.results-search-form input[type="text"] {
    width: 590px;
    height: 32px;
    line-height: 32px;
    padding: 0 9px;
    border: 1px solid #d9d9d9;
    border-right: 0;
    font-size: 16px;
    outline: none;
}

.results-search-form input[type="text"]:focus {
    border-color: #4285f4;
}

.results-search-form button {
    width: 86px;
    height: 34px;
    line-height: 34px;
    padding: 0;
    background: #4d7dea;
    border: 1px solid #4d7dea;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
}

.results-search-form button:hover {
    background: #3367d6;
}

.results-user-area {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-container {
    margin-left: 150px;
    padding-top: 18px;
    width: 650px;
}

.result-count {
    color: #666;
    font-size: 13px;
    margin: 0 0 22px 0;
}

.result-item {
    margin-bottom: 24px;
}

.result-item h2 {
    font-size: 18px;
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
}

.result-item h2 a {
    text-decoration: none;
}

.result-item h2 a:hover {
    text-decoration: underline;
}

.result-url {
    color: #006621;
    font-size: 14px;
    line-height: 1.4;
}

.result-item p {
    color: #545454;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.no-results {
    color: #333;
    font-size: 14px;
}

/* -------------------------
   Login / Register pages
------------------------- */

.login-page {
    background: #f7f7f7;
    min-height: 100vh;
}

.login-box {
    width: 380px;
    margin: 105px auto 0 auto;
    background: #fff;
    border: 1px solid #ddd;
    padding: 32px;
}

.register-box {
    width: 420px;
}

.login-logo {
    display: block;
    width: 160px;
    height: auto;
    margin: 0 auto 24px auto;
}

.login-box h1 {
    font-size: 22px;
    font-weight: normal;
    margin: 0 0 18px 0;
}

.login-box label {
    display: block;
    font-weight: bold;
    font-size: 13px;
    margin: 12px 0 6px 0;
}

.login-box input[type="text"],
.login-box input[type="email"],
.login-box input[type="password"] {
    width: 100%;
    height: 34px;
    border: 1px solid #c6c6c6;
    padding: 6px 8px;
    font-size: 14px;
}

.login-box small {
    display: block;
    color: #777;
    margin: -4px 0 10px;
    font-size: 11px;
}

.signin-wide {
    width: 100%;
    height: 38px;
    margin-top: 18px;
    background: #4d7dea;
    border: 1px solid #4d7dea;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.signin-wide:hover {
    background: #3367d6;
}

.back-link {
    text-align: center;
    margin: 14px 0 0 0;
}

.error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #a3261a;
    padding: 8px;
    font-size: 13px;
}

.success {
    background: #e9f5e9;
    border: 1px solid #b8ddb8;
    color: #166516;
    padding: 8px;
    font-size: 13px;
}

/* -------------------------
   Simple topbar
------------------------- */

.simple-topbar {
    height: 64px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
}

.topbar-logo {
    width: 112px;
    height: auto;
    display: block;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* -------------------------
   Account page
------------------------- */

.account-page {
    background: #f7f7f7;
}

.account-container {
    width: 780px;
    margin: 70px auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.profile-card,
.settings-card,
.read-mail-card {
    background: #fff;
    border: 1px solid #dcdcdc;
    padding: 24px;
}

.profile-card h1,
.settings-card h2 {
    font-weight: normal;
    margin-top: 0;
}

.big-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid #ccc;
    display: block;
    margin-bottom: 18px;
}

.muted {
    color: #777;
}

.settings-card label {
    display: block;
    font-weight: bold;
    margin: 14px 0 6px;
}

.settings-card input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c6c6c6;
    padding: 9px;
    font-size: 14px;
    background: #fff;
}

/* -------------------------
   DMAIL
------------------------- */

.mail-page {
    background: #fff;
}

.mail-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: calc(100vh - 65px);
}

.mail-sidebar {
    border-right: 1px solid #e5e5e5;
    padding: 26px 18px;
    background: #f7f7f7;
}

.mail-sidebar a {
    display: block;
    padding: 9px 10px;
    color: #222;
    text-decoration: none;
    font-size: 14px;
}

.mail-sidebar a:hover,
.mail-sidebar a.active {
    background: #e8eefc;
    color: #1a0dab;
}

.compose-button {
    display: inline-block !important;
    background: #4d7dea !important;
    color: #fff !important;
    text-align: center;
    margin-bottom: 18px;
    border-radius: 2px;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 14px !important;
}

.compose-button.inline {
    margin-top: 16px;
}

.mail-list {
    padding: 28px 34px;
    max-width: 900px;
}

.mail-list h1,
.compose-container h1,
.read-container h1 {
    font-weight: normal;
    margin-top: 0;
}

.mail-row {
    display: flex;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e5e5;
    color: #222;
    text-decoration: none;
    background: #fff;
}

.mail-row:hover {
    background: #f7f9ff;
    text-decoration: none;
}

.mail-row.unread {
    font-weight: bold;
    background: #f1f5ff;
}

.mail-avatar {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid #d6d6d6;
    flex: 0 0 auto;
}

.mail-avatar.large {
    width: 64px;
    height: 64px;
}

.mail-main {
    flex: 1;
    min-width: 0;
}

.mail-row-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
}

.mail-row-top span,
.mail-snippet {
    color: #777;
    font-weight: normal;
}

.mail-subject {
    margin: 4px 0;
}

.compose-container,
.read-container {
    width: 760px;
    margin: 50px auto;
}

.compose-form label {
    display: block;
    font-weight: bold;
    margin: 14px 0 6px;
}

.compose-form input,
.compose-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c6c6c6;
    padding: 9px;
    font-size: 14px;
}

.compose-form textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.read-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.read-body {
    font-size: 15px;
    line-height: 1.55;
    white-space: normal;
}

/* -------------------------
   Responsive
------------------------- */

@media (max-width: 800px) {
    .home-center {
        padding-top: 140px;
        max-width: 95%;
    }

    .home-logo {
        width: 230px;
    }

    .home-search input[type="text"] {
        width: 90%;
    }

    .results-header {
        height: auto;
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .results-search-form {
        width: 100%;
        max-width: none;
    }

    .results-search-form input[type="text"] {
        width: calc(100% - 86px);
    }

    .results-container {
        margin-left: 16px;
        margin-right: 16px;
        width: auto;
    }

    .account-container,
    .compose-container,
    .read-container {
        width: auto;
        margin: 30px 16px;
        display: block;
    }

    .profile-card {
        margin-bottom: 20px;
    }

    .mail-layout {
        display: block;
    }

    .mail-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e5e5e5;
    }
}


/* Final features: account settings + admin database panel */
.wide-account {
    width: 920px;
    grid-template-columns: 280px 1fr;
}

.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"],
.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c6c6c6;
    padding: 9px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
}

.settings-card hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 26px 0;
}

.admin-page {
    background: #f7f7f7;
}

.admin-container {
    width: 1100px;
    margin: 34px auto;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
}

.admin-card {
    background: #fff;
    border: 1px solid #dcdcdc;
    padding: 22px;
}

.admin-card h1 {
    font-weight: normal;
    font-size: 22px;
    margin: 0 0 18px 0;
}

.admin-form label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
}

.admin-form textarea {
    resize: vertical;
}

.admin-form small {
    display: block;
    color: #777;
    margin-top: 4px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
}

.checkbox-label input {
    width: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: top;
    padding: 9px 7px;
}

.admin-table th {
    background: #f2f2f2;
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions form {
    display: inline;
    margin-left: 8px;
}

.admin-actions button {
    border: 0;
    background: none;
    color: #d93025;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

@media (max-width: 1000px) {
    .wide-account,
    .admin-container {
        width: auto;
        margin: 24px 16px;
        display: block;
    }

    .admin-card {
        margin-bottom: 20px;
    }
}


/* Delete account danger area */
.danger-form {
    border: 1px solid #f1c7c7;
    background: #fff7f7;
    padding: 14px;
}

.delete-account-button {
    width: 100%;
    height: 38px;
    margin-top: 18px;
    background: #d93025;
    border: 1px solid #d93025;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.delete-account-button:hover {
    background: #b3261e;
}


/* Search autocomplete suggestions */
.home-search,
.results-search-form {
    position: relative;
}

.suggestions-box {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 41px;
    width: 586px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-top: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.18);
    z-index: 1000;
    text-align: left;
    font-size: 16px;
}

.results-suggestions-box {
    left: 0;
    transform: none;
    top: 34px;
    width: 590px;
}

.suggestion-row {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #222;
}

.suggestion-row:hover,
.suggestion-row.active {
    background: #f1f1f1;
}

.suggestion-icon {
    color: #777;
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.suggestion-icon.history {
    color: #777;
}

.suggestion-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
