/* Minimalist StartPage CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    text-align: center;
}

/* Layout improvements for better spacing and compactness */
.layout-section {
    margin-bottom: 1rem;
    width: 100%;
}

.layout-section.compact {
    margin-bottom: 0.75rem;
}

.layout-section.tight {
    margin-bottom: 0.5rem;
}

/* Combined Section */
.combined-section {
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.combined-section .time-date-section {
    margin-bottom: 0.75rem;
}

.time-weather-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* Weather Module */
.weather-section {
    cursor: pointer;
}

.weather-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    /* background: #f8f9fa; */
    border-radius: 6px;
    /* box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); */
    transition: all 0.3s ease;
}

.weather-card:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.weather-icon {
    font-size: 1.5rem;
    color: #ffc107;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-temp {
    font-size: 1.2rem;
    font-weight: 500;
    color: #212529;
}

.weather-desc {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Header */
.header {
    margin-bottom: 1rem;
}

.greeting h1 {
    font-size: 1.8rem;
    font-weight: 400;
    color: #212529;
    margin: 0.5rem 0;
}

/* Search Section */
.search-section {
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    margin-bottom: 0.75rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

#search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 3rem;
    font-size: 0.95rem;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#search-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.engine-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.engine-btn:hover {
    border-color: #86b7fe;
    background: #f8f9fa;
}

.engine-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Time and Date Module */
.time-date-section {
    margin-bottom: 0.75rem;
    text-align: center;
}

.time-section {
    display: inline-block;
    padding: 0.6rem 0.8rem;
    background: #fff;
    border-radius: 6px;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); */
    margin: 0 auto;
}

.time {
    font-size: 1.8rem;
    font-weight: 300;
    color: #495057;
    margin-bottom: 0.1rem;
}

.date {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Quick Links */
.quick-links {
    margin-bottom: 1rem;
}

.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 0.6rem;
}

.link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.4rem;
    background: #fff;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.link-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    color: #0d6efd;
}

.link-item i {
    font-size: 1rem;
}

.link-item span {
    font-size: 0.7rem;
}

/* News Section */
.section-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.6rem;
    text-align: left;
    padding-left: 0.2rem;
}

.news-container {
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-loading {
    text-align: center;
    color: #6c757d;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.news-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background-color: #f8f9fa;
    padding-left: 0.3rem;
}

.news-item a {
    text-decoration: none;
    color: inherit;
}

.news-image-container {
    margin-bottom: 0.4rem;
}

.news-image-container img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.news-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.3rem;
    cursor: pointer;
    line-height: 1.3;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #6c757d;
}

.news-source {
    font-weight: 500;
}

/* Tools Section */
.tools-section {
    margin-bottom: 0;
}

.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 0.6rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.4rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.tool-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #0d6efd;
}

.tool-card i {
    font-size: 1rem;
}

.tool-card span {
    font-size: 0.7rem;
}

/* Tool Modals */
.tool-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.tool-modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    max-height: 75vh;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #212529;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #000;
    background: #f8f9fa;
    border-radius: 50%;
}

/* Calculator */
.calculator {
    padding: 0.75rem;
}

.calc-display {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 0.6rem;
    font-size: 1.2rem;
    text-align: right;
    margin-bottom: 0.6rem;
    min-height: 35px;
    word-wrap: break-word;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
}

.calc-btn {
    padding: 0.6rem;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-btn:hover {
    background: #f8f9fa;
}

.calc-btn:active {
    background: #e9ecef;
}

.calc-btn.equal {
    grid-row: span 2;
    background: #0d6efd;
    color: white;
}

.calc-btn.equal:hover {
    background: #0b5ed7;
}

.calc-btn.zero {
    grid-column: span 2;
}

/* Weather Tool */
.weather-tool {
    padding: 0.75rem;
}

.weather-search {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.weather-search input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.85rem;
}

.weather-search button {
    padding: 0.5rem 1rem;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.weather-search button:hover {
    background: #0b5ed7;
}

.weather-result {
    text-align: center;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.weather-main i {
    font-size: 2.2rem;
    color: #ffc107;
}

.temp {
    font-size: 1.8rem;
    font-weight: 300;
}

.weather-desc {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.3rem;
}

.city {
    font-size: 0.85rem;
    color: #6c757d;
}

.weather-details {
    display: flex;
    justify-content: space-around;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eee;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-item span:first-child {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.detail-item span:last-child {
    font-weight: 500;
    font-size: 0.85rem;
}

/* Currency Converter Tool */
.currency-tool {
    padding: 0.75rem;
}

.currency-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: center;
}

.currency-input input {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.85rem;
}

.currency-input select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.85rem;
    background: #fff;
}

.currency-input span {
    font-weight: 500;
    color: #495057;
}

.currency-result {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.result-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.converted-amount {
    font-size: 1.2rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 1rem;
}

#currency-swap {
    padding: 0.4rem 0.8rem;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

#currency-swap:hover {
    background: #0b5ed7;
}

/* Notes Tool */
.notes-tool {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    height: 300px;
}

.notes-tool textarea {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    margin-bottom: 0.75rem;
}

.notes-tool button {
    align-self: flex-end;
    padding: 0.5rem 1rem;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.notes-tool button:hover {
    background: #0b5ed7;
}

/* Footer */
.footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.quote {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments for tools */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .time {
        font-size: 1.6rem;
    }
    
    .greeting h1 {
        font-size: 1.3rem;
    }
    
    .links-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .link-item {
        padding: 0.5rem 0.3rem;
    }
    
    .tool-card {
        padding: 0.5rem 0.3rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 90%;
    }
    
    .weather-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .notes-tool {
        height: 200px;
    }
    
    .tools-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .tool-card span {
        font-size: 0.6rem;
    }
    
    .link-item span {
        font-size: 0.6rem;
    }
    
    .news-section, .quick-links {
        margin-bottom: 0.7rem;
    }
    
    .section-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .news-container {
        padding: 0.5rem;
    }
    
    .news-title {
        font-size: 0.75rem;
    }
    
    .combined-section {
        padding: 0.6rem;
    }
    
    .time-weather-section {
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .weather-card {
        justify-content: center;
        padding: 0.5rem;
    }
    
    .weather-temp {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .tools-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .tool-card {
        padding: 0.4rem 0.2rem;
    }
    
    .tool-card span {
        font-size: 0.55rem;
    }
    
    .links-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    
    .link-item {
        padding: 0.4rem 0.2rem;
    }
    
    .link-item span {
        font-size: 0.55rem;
    }
    
    .weather-search {
        flex-direction: column;
    }
    
    .currency-input {
        flex-direction: column;
    }
    
    .calc-buttons {
        gap: 0.1rem;
    }
    
    .calc-btn {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    .time {
        font-size: 1.4rem;
    }
    
    .greeting h1 {
        font-size: 1.1rem;
    }
    
    .news-section, .quick-links {
        margin-bottom: 0.6rem;
    }
    
    .search-box {
        margin-bottom: 0.5rem;
    }
    
    #search-input {
        padding: 0.4rem 0.7rem 0.4rem 2rem;
        font-size: 0.8rem;
    }
    
    .combined-section {
        padding: 0.5rem;
    }
    
    .time-section {
        padding: 0.5rem 0.7rem;
    }
    
    .weather-card {
        padding: 0.4rem;
    }
    
    .weather-temp {
        font-size: 0.9rem;
    }
}