/* General reset and font styling */
* {
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}

/* Body styling */
body {
    background: #080f28; /* Default background color */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-size: cover; /* Ensure background images cover the page */
    background-position: center;
    background-repeat: no-repeat; /* Prevent image repetition */
    background-image:url("../images/default-bg.jpg");
    transition: background 1s ease-in-out, 
   
}


.card {
    width: 90%;
    max-width: 470px;
    margin: 20px auto;
    padding: 40px 35px;
    text-align: center;
    color: #fff;
    border-radius: 20px;
    box-shadow: 0px 5px 20px rgb(1, 21, 87);
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        -135deg, 
        rgb(0, 0, 0), /* Darker black */
        rgba(40, 35, 54, 0.8) /* Darker shade of purple/blue */
    );
    z-index: 1;

    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;

    border-top: 1px solid rgba(255, 49, 49,1);
    border-right: 1px solid rgba(0, 255, 255,1);
    border-bottom: 1px solid rgba(255, 87, 34,1); /* Orange */
    border-left: 1px solid rgba(156, 39, 176,1); /* Purple */
}

.card .top,
.card .bottom,
.card .right,
.card .left {
    position: absolute;
    transition: all 1s ease-in-out;
}

.card .top {
    top: 0;
    left: 0;
    width: 35%;
    height: 10px;
    background: linear-gradient(
      90deg,
      rgb(119, 199, 21, 0) 0%, /* Dark head */
      rgb(119, 199, 21, 1) 50%, /* Blue */
      rgb(119, 199, 21, 0) 100% /* Slightly faded tail */
    );
    animation: animateTop 3s ease-in-out infinite;
}

.card .bottom {
    right: 0;
    bottom: 0;
    width: 35%;
    height: 10px;
    background: linear-gradient(
      90deg,
      rgb(255, 159, 34, 0) 0%, /* Dark head */
      rgb(255, 159, 34, 1) 50%, /* Orange */
      rgb(255, 159, 34, 0) 100% /* Slightly faded tail */
    );
    animation: animateBottom 3s ease-in-out infinite;
}

.card .right {
    top: 0;
    right: 0;
    width: 10px;
    height: 35%;
    background: linear-gradient(
      180deg,
      rgba(0, 255, 255, 0) 0%, /* Dark head */
      rgba(0, 255, 255, 1) 50%, /* Cyan */
      rgba(0, 255, 255, 0) 100% /* Slightly faded tail */
    );
    animation: animateRight 3s ease-in-out infinite;
}

.card .left {
    left: 0;
    bottom: 0;
    width: 10px;
    height: 35%;
    background: linear-gradient(
      180deg,
      rgba(156, 39, 176, 0) 0%, /* Dark head */
      rgba(156, 39, 176, 1) 50%, /* Purple */
      rgba(156, 39, 176, 0) 100% /* Slightly faded tail */
    );
    animation: animateLeft 3s ease-in-out infinite;
}

@keyframes animateTop {
    25% {
      width: 100%;
      opacity: 1;
    }

    30%,
    100% {
      opacity: 0;
    }
}

@keyframes animateBottom {
    0%,
    50% {
      opacity: 0;
      width: 0;
    }

    75% {
      opacity: 1;
      width: 100%;
    }

    76%,
    100% {
      opacity: 0;
    }
}

@keyframes animateRight {
    0%,
    25% {
      opacity: 0;
      height: 0;
    }

    50% {
      opacity: 1;
      height: 100%;
    }

    55%,
    100% {
      height: 100%;
      opacity: 0;
    }
}

@keyframes animateLeft {
    0%,
    75% {
      opacity: 0;
      bottom: 0;
      height: 0;
    }

    100% {
      opacity: 1;
      height: 100%;
    }
}

.card:hover {
    box-shadow: 
        0 0 10px 5px rgba(184, 134, 11, 0.7), /* Inner glow */
        0 0 20px 10px rgba(218, 165, 32, 0.5), /* Outer glow */
        0 0 30px 15px rgba(255, 215, 0, 0.5); /* Farthest glow */
    filter: drop-shadow(0 0 80px rgba(218, 165, 32, 1)); /* Extra shadow effect */
}




/* Before search: Initial state */
.card.before-search {
    transform: translateY(-150px); /* Moves card up */
    background: linear-gradient(
        -135deg, 
        rgba(0, 0, 0, 1), 
        rgb(0, 0, 0,1)
    );
    
}


/* After search: Post-search state (both successful and error cases) */
/* After search: Post-search state (both successful and error cases) */
.card.after-search {
    transform: translateY(0); /* Reset position */
    background: linear-gradient(
        -135deg, 
        rgba(53, 50, 50, 0.664), 
        rgba(0, 0, 0, 0.3)
    );
    box-shadow: none !important; /* Remove any existing box-shadow */
    filter: none !important; /* Remove any applied filter effects */
}



.card.error {
    background: linear-gradient(
        -135deg, 
        rgba(43, 31, 31, 0.8), 
        rgba(27, 21, 21, 0.5)
    );
    margin-top:125px; /* Center the card */
    left:35px;
    
    width: 51%; /* Adjust width to be responsive */
    max-width:470px; /* Limit max width */
    height:475px;
    border-radius:18px;
    box-sizing: border-box;
    animation: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: none; /* Ensure no restriction */
    overflow: visible;
}






/* Search bar container */
.search {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

/* Input styling for search */
.search input {
    border: none;
    border: 2px solid rgba(0, 225, 255, 0.8); /* Outline-like border */
    outline: none;
    background: linear-gradient(
        -135deg,
        rgba(53, 50, 50, 0.8),
        rgba(0, 0, 0, 0.3)
    );
    color: white;
    padding: 12px 30px;
    height: 60px;
    border-radius: 35px;
    font-size: 18px;
    flex: 1;
    caret-color: rgba(0, 225, 255, 0.8); /* Cursor color for text input */
    transition: all 0.3s ease;
    font-family: 'Pacifico', cursive; /* Handwriting font */
}

/* Placeholder styling */
.search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    opacity: 1;
    font-family: 'Pacifico', cursive; /* Handwriting font */
}



/* Search button styling */
.search button {
    border: none;
    outline: none;
    background: linear-gradient(
        -135deg,
        rgba(53, 50, 50, 0.8),
        rgba(0, 0, 0, 0.3)
    );
    border-radius: 50%;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(0, 225, 255, 0.8); /* Outline-like border */
    outline: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Button hover effect */
.search button:hover {
    transform: scale(1.15);
    background:  rgba(0, 225, 255, 0.9);
    
}





/* Search button icon styling */
.search button img {
    width: 20px;
    height: 20px;
}


/*weather card*/

.weather-icon{
     width:170px !important;
     margin-top: 30px;
}

.weather h1{
    font-size: 80px;
    font-weight: 500;
}

.weather h2{
    font-size: 45px;
    font-weight: 400;
    margin-top:-10px;
}

.details{
    display: flex;
    align-items: center;
    justify-content:space-between ;
    padding:0 20px;
    margin-top:50px ;
}

.col{
    display: flex;
    align-items: center;
    text-align: center;

}

.col img{
    width:40px;
    margin-right: 10px;
}

.humidity,.wind{
    font-size:28px;
    margin-top: -6px;
}

/* previously it is showing by default new york hence only after search it shld show */
.weather{
    display:none;
}




/* Error card styling (matching after search card style) */
.error {
    width: 380px;
    padding:12px;
    color: #ff0000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px auto;
    background: linear-gradient(
        -135deg, 
        rgba(0, 0, 0, 0.7), 
        rgba(0, 0, 0, 0.8)
    );
    box-sizing: border-box;
    border-radius: 5px;
    text-align: center;
    font-family: sans-serif;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    animation: glowingBorder 1.5s infinite alternate, zoomInOut 2s infinite ease-in-out;
    display:none;
}



/* Glowing border and zoom-in effect */
@keyframes glowingBorder {
    0% {
        border-color: transparent;
        box-shadow: 0 0 5px rgba(33, 150, 243, 0.8), 0 0 10px rgba(33, 150, 243, 0.8), 0 0 15px rgba(33, 150, 243, 0.8);
    }
    50% {
        border-color: transparent;
        box-shadow: 0 0 5px rgba(255, 64, 129, 0.8), 0 0 10px rgba(255, 64, 129, 0.8), 0 0 15px rgba(255, 64, 129, 0.8);
    }
    100% {
        border-color: transparent;
        box-shadow: 0 0 5px rgba(33, 150, 243, 0.8), 0 0 10px rgba(33, 150, 243, 0.8), 0 0 15px rgba(33, 150, 243, 0.8);
    }
}

@keyframes zoomInOut {
    0% {
        transform: scale(1); /* Original size */
    }
    50% {
        transform: scale(1.1); /* Slightly zoomed in */
    }
    100% {
        transform: scale(1); /* Back to original size */
    }
}

/* Error message text */
.error p {
    margin: 0;
    font-size: 10px; /* Slightly increased for readability */
    font-weight: bold;
    font: clamp(.5em, 1vw + 1vh, 2em) 'Playfair Display', cursive; /* Slightly increased clamp values */
}


