/* ============================================================
   Surf Weather — Shared Stylesheet
   Used by: index.html, favorites.html, login.html
   ============================================================ */

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

/* ----- Reset ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----- Base ----- */
body {
    font-family: 'Sora', sans-serif;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

body.bg-login {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body.bg-login::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* ----- Layout ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container--narrow {
    max-width: 1000px;
    margin: 0 auto;
}

/* ----- Cards ----- */
.header-card {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    margin-bottom: 20px;
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.header-card--glass {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 40px;
    margin-top: 20px;
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.results-card {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top: 2px solid rgba(38, 208, 206, 0.5);
    backdrop-filter: blur(18px);
}

/* ----- Typography ----- */
h1 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 30px;
    font-size: 0.9em;
}

.section-title {
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75em;
}

.timestamp {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78em;
    margin-bottom: 16px;
}

/* ----- Forms ----- */
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #26d0ce;
}

/* ----- Buttons ----- */
.button-group {
    display: flex;
    gap: 12px;
}

button {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(38, 208, 206, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-secondary {
    flex: none;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78em;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 0;
    align-self: flex-start;
    letter-spacing: 0.02em;
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: none;
}

.btn-weather {
    flex: none;
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 6px;
    min-width: 120px;
}

.favorite-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Small delete button (consistent with conditions view) */
.btn-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
}

.btn-delete:hover {
    background: #ff5252;
}

/* Ensure icons inside small action buttons remain small */
.btn-delete svg,
.btn-view svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* Force small delete button sizing in all contexts (override unexpected rules) */
.btn-delete {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    flex: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-delete svg {
    width: 15px !important;
    height: 15px !important;
}

.button-back {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(38, 208, 206, 0.35);
}

/* ----- Profile menu ----- */
.profile-menu-container {
    position: relative;
}

.profile-button {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: none;
}

.profile-button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(38, 208, 206, 0.4);
}

.profile-button:active {
    transform: scale(0.95);
}

.profile-button svg {
    width: 24px;
    height: 24px;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    border-radius: 12px;
    margin: 8px;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #f44336;
}

.dropdown-item:active {
    background-color: #efefef;
}

/* ----- Results section ----- */
.results {
    display: none;
}

.results.show {
    display: block;
    animation: fadeIn 0.5s;
}

.location-card {
    padding: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 16px;
}

.location-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 3px;
}

.coordinates {
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.5);
}

/* ----- Current conditions — big metric cards ----- */
.current-conditions {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 24px;
}

.metric-cards-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .metric-cards-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 560px) {
    .metric-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-big-card {
    border-radius: 16px;
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: relative;
    min-height: 160px;
}

.metric-big-card--wave {
    background: linear-gradient(145deg, rgba(38, 208, 206, 0.13) 0%, rgba(20, 184, 166, 0.07) 100%);
    border: 1px solid rgba(45, 212, 191, 0.25);
}

.metric-big-card--wind {
    background: linear-gradient(145deg, rgba(38, 208, 206, 0.13) 0%, rgba(20, 184, 166, 0.07) 100%);
    border: 1px solid rgba(45, 212, 191, 0.25);
}

.metric-big-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.metric-big-card--wave .metric-big-icon {
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
}

.metric-big-card--wind .metric-big-icon {
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
}

.metric-big-icon svg {
    width: 20px;
    height: 20px;
}

.metric-big-name {
    font-size: 0.68em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1;
}

.metric-big-value {
    font-size: 2em;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 2px;
}

.metric-big-card--wave .metric-big-value {
    color: #fff;
}

.metric-big-card--wind .metric-big-value {
    color: #fff;
}

.metric-big-unit {
    font-size: 0.45em;
    font-weight: 500;
    opacity: 0.6;
    margin-left: 2px;
    vertical-align: middle;
}


.metric-big-sub {
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.45);
    margin-top: auto;
    padding-top: 6px;
}

/* ----- Forecast section ----- */
.forecast-section {
    padding: 0;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.forecast-card {
    background: transparent;
    color: white;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s, background 0.2s;
}

.forecast-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent;
}

.forecast-date {
    font-weight: 700;
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.forecast-grid-table {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
}

.forecast-table-header {
    font-size: 0.68em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.forecast-table-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78em;
    font-weight: 400;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.forecast-table-value {
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

/* Wind values */
.forecast-grid-table > .forecast-table-label:nth-child(10),
.forecast-grid-table > .forecast-table-label:nth-child(13) {
    color: rgba(255, 255, 255, 0.45);
}

.forecast-grid-table > .forecast-table-value:nth-child(11),
.forecast-grid-table > .forecast-table-value:nth-child(12),
.forecast-grid-table > .forecast-table-value:nth-child(14),
.forecast-grid-table > .forecast-table-value:nth-child(15) {
    color: rgba(255, 255, 255, 0.9);
}

.forecast-table-label:last-of-type,
.forecast-table-value:nth-last-child(-n+2) {
    border-bottom: none;
}

/* ----- Error / feedback ----- */
.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.error.show {
    display: block;
    animation: fadeIn 0.5s;
}

/* ----- Loading / spinner ----- */
.loading {
    text-align: center;
    margin-top: 20px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #26d0ce;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ----- Modals ----- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.modal-title {
    font-size: 1.8em;
    color: #333;
    font-weight: 700;
}

.close-btn {
    font-size: 2em;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: auto;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
    transform: none;
    box-shadow: none;
}

.alert-location {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}

.alert-location-name {
    font-weight: 600;
    color: #1a2980;
    font-size: 1.1em;
}

.alert-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.alert-item.match {
    border-color: #26d0ce;
    background: linear-gradient(135deg, rgba(26, 41, 128, 0.05) 0%, rgba(38, 208, 206, 0.1) 100%);
}

.alert-match-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 6px;
}

.alert-match-days {
    font-size: 0.82em;
    color: #26d0ce;
    margin-top: 4px;
    font-weight: 500;
}

.alert-item:hover {
    border-color: #26d0ce;
    background-color: #f8f9ff;
    transform: translateX(5px);
}

.alert-item-name {
    font-weight: 600;
    color: #1a2980;
    font-size: 1.1em;
}

.alert-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
}

.alert-action {
    background: transparent;
    border: 1px solid rgba(26, 41, 128, 0.08);
    color: #1a2980;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.82em;
    cursor: pointer;
}

.alert-action.edit-action {
    background: rgba(26, 41, 128, 0.06);
}

.alert-action.delete-action {
    background: rgba(255, 77, 79, 0.08);
    color: #c33;
    border-color: rgba(255, 77, 79, 0.12);
}

/* Ensure the alerts list allows visible horizontal overflow so hover transform isn't clipped */


.no-alerts {
    text-align: center;
    padding: 30px;
    color: #888;
}

.parameter-group {
    margin-bottom: 25px;
}

.parameter-label {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.range-input {
    display: flex;
    flex-direction: column;
}

.range-input label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.range-input input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cancel {
    background: #e0e0e0;
    color: #666;
    border: none;
}

.btn-cancel:hover {
    background: #d0d0d0;
    box-shadow: none;
}

.btn-save {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    border: none;
}

/* ----- Favorites ----- */
.favorite-card {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 20px;
    backdrop-filter: blur(14px);
}

.empty-state {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

.favorite-item {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.favorite-info {
    flex: 1;
}

.favorite-name {
    font-weight: 600;
    color: #fff;
    font-size: 1.1em;
}

.favorite-coords {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 4px;
}

.favorite-actions {
    display: flex;
    gap: 8px;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
}

.btn-delete:hover {
    background: #ff5252;
}

/* ----- Login page ----- */
.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 0.9em;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    color: #666;
    font-weight: 600;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #26d0ce;
    border-bottom-color: #26d0ce;
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: fadeIn 0.3s;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.3s;
}

.message.show {
    display: block;
}

.message.error {
    background: #fee;
    color: #c33;
}

.message.success {
    background: #efe;
    color: #3c3;
}

.forgot-password {
    text-align: right;
    margin-top: 10px;
}

.forgot-password a {
    color: #26d0ce;
    text-decoration: none;
    font-size: 0.9em;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* ----- Animations ----- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }
}

/* ----- Heart Button (Favorite) ----- */
.heart-button {
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.heart-button::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.6)" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>') no-repeat center;
    background-size: contain;
    transition: background-image 0.3s ease;
}

.heart-button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: none;
    box-shadow: none;
}

.heart-button.filled::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2326d0ce" stroke="%2326d0ce" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>') no-repeat center;
    background-size: contain;
}

.heart-button.filled {
    background: rgba(38, 208, 206, 0.15);
    border-color: rgba(38, 208, 206, 0.4);
}