@import url('https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Indie+Flower&family=Pacifico&display=swap');
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
}

header {
    text-align: center;
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    color: white;
    box-shadow: none;
}

.navbar {
    padding: 0 !important;
    position: relative;
    min-height: 77px;
    display: flex;
    align-items: center;
}

#slogan {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: max-content;
    z-index: 10;
}

.handwrite {
    font-family: 'Indie Flower', cursive;
    color: #F29100;
    text-align: center;
    font-size: 1.5em;
}

.subtitle {
    color: #ffffff;
    font-size: 0.9rem;
    margin-top: -5px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.main-content {
    padding-top: 8px;
    padding-bottom: 40px;
    min-height: calc(100vh - 200px);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 32px;
    margin-top: 0;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.modern-search {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    background: #fff;
    border-radius: 18px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1.5px solid #e0e0e0;
}

.modern-search-field {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px 10px 0.3em 10px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.07);
    margin-right: 24px;
    min-width: 208px;
    max-width: 272px;
    margin-bottom: 0;
    height: 62px;
}

.modern-search .form-control::placeholder {
    color: #4CAF7A;
    font-size: 1.2em;
    font-weight: 500;
    opacity: 1;
}

.modern-search .form-control {
    font-size: 16px;
    padding-top: 8px;
    padding-bottom: 8px;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: none;
}

.modern-search-btn-wrap {
    display: flex;
    align-items: stretch;
    height: 100%;
}

.modern-search .btn-primary {
    background-color: #F29100;
    border-color: #F29100;
    font-size: 18px;
    font-weight: 700;
    height: 62px;
    padding: 0 32px;
    border-radius: 8px;
    transition: background 0.2s;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modern-search .btn-primary:hover {
    background-color: #E67E22;
    border-color: #E67E22;
}

.modern-search .btn-primary:focus {
    outline: none;
    box-shadow: none;
}

.view-options {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.view-btn {
    background-color: #F29100;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.view-btn:hover,
.view-btn.active {
    background-color: #E67E22;
}

.webcam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.webcam-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.webcam-card:hover {
    transform: translateY(-5px);
}

.webcam-card h2 {
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
}

.webcam-img-container {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%;
}

.webcam-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.webcam-card:hover .webcam-img {
    transform: scale(1.05);
}

.webcam-info {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.webcam-location {
    font-size: 0.9rem;
    color: #666;
}

.webcam-timestamp {
    font-size: 0.8rem;
    color: #999;
}

.view-original-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #F29100;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 2;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.view-original-btn:hover {
    background-color: #E67E22;
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    z-index: 3;
}

.hidden {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: 100px;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background-color: white;
    padding: 10px;
    border-radius: var(--border-radius);
    max-width: 90%;
    max-height: calc(90vh - 100px);
    overflow: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.modal-image {
    display: block;
    max-width: 100%;
    max-height: calc(80vh - 120px);
    margin: 0 auto;
    object-fit: contain;
    width: auto;
    height: auto;
}

.modal-title {
    margin-top: 10px;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    border: none;
}

.close-modal:hover {
    background-color: #E67E22;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0;
}

.logo-left {
    width: 5% !important;
    min-width: unset;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    align-items: center;
    padding-left: 16px;
}

@media (max-width: 900px) {
    .controls {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .modern-search {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
        padding: 8px 0 !important;
    }
    .modern-search-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .modern-search-field {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-right: 0 !important;
    }
    .modern-search-btn-wrap {
        width: 100% !important;
        margin-top: 8px !important;
    }
    .modern-search .btn-primary {
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 12px !important;
    }
    .view-options {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-left: 8px;
        padding-right: 8px;
    }
    .webcam-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .webcam-card h2 {
        font-size: 1rem;
        padding: 10px;
    }
    .modal-content {
        width: 95%;
    }
    #slogan {
        font-size: 1.2em;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (min-width: 576px) {
    .handwrite {
        font-size: 1.5em;
        display: block;
    }
}

@media (min-width: 768px) {
    .handwrite {
        font-size: 1.5em;
    }
}

@media (min-width: 992px) {
    .handwrite {
        font-size: 1.9em;
    }
}

@media (min-width: 1200px) {
    .handwrite {
        font-size: 2.3em;
    }
}

.modern-search-label {
    /*color: #2c3e50;*/
    color: #F29100;
    font-weight: 500;
    font-size: 0.91rem;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 0;
    margin-top: 0;
    margin-left: 0;
    text-align: left;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.modern-search-field .form-control {
    font-size: 1.04rem;
    height: 36px;
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    color: #222;
    display: block;
    align-items: center;
}

.modern-search-title {
    display: block;
    color: #222;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 4px;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    margin-top: 0;
}

.modern-search-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 0px;
}