/*  1. YLEISET ASETUKSET (KAIKKI SIVUT) */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-dark);
    margin: 0;
    padding: 20px;
    color: var(--text-main);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 35px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
}

h1, h2, h3 {
    color: #222;
    border-left: 5px solid #066b13; 
    padding-left: 10px;
}

p {
    color: #333;
    line-height: 1.6;
}

/* Linkit */
a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   THEME VARIABLES
========================= */
:root {
    --bg-dark: black; /* sivun taustaväri */
    --bg-card: #ffffff; /* kaupan taustaväri */

    --primary: #056605; /* tilaa painikkeet */
    --primary-dark: #045704; /* navbar pääväri */ 
    --accent: #60ee60; /* navbar toinen väri */

    --text-main: #058b5f;
    --text-muted: #f010b8;
    --text-inverse: white; /* hero + tilaa painike väri tekstin väri*/

    --border-radius: 14px;
}

/* =========================
   2. LOMAKKEET (kirjautuminen, rekisteröinti, admin)
========================= */
form {
    margin-top: 20px;
}

input[type=text],
input[type=password],
input[type=number],
input[type=date],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 15px;
}

button,
.index-login {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: 12px 18px;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
}


button:hover,
.index-login:hover {
    background: var(--primary-dark);
}

/* Virheilmoitus */
.error {
    background: #ffdddd;
    padding: 10px;
    border-left: 5px solid #e60000;
    color: #b30000;
    margin-bottom: 15px;
}

.index-register {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}


/* =========================
   AUTH (kirjautuminen & rekisteröinti)
========================= */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.25);
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    border: none;
    text-align: center;
}

/* Inputtien viimeistely */
.auth-card input[type=text],
.auth-card input[type=password] {
    padding: 12px;
    font-size: 16px;
}

/* Kirjautumisnappi */
.auth-card button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
}

/* Lisälinkit */
.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: #4CAF50;
}

/* =========================
   3. TAULUKOT (ADMIN)
========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: #333;
}

th {
    background: #4CAF50;
    color: white;
    padding: 10px;
    text-align: left;
}

td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

tr:nth-child(even) {
    background: #f6f6f6;
}

/* =========================
   4. NAVIGAATIO (KAIKKI)
========================= */
.nav {
    background: linear-gradient(135deg, var(--accent), var(--primary-dark));
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    text-align: right;
}
.nav a {
    color: var(--text-inverse);
    margin-left: 20px;
    position: relative;
}


.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.25s ease;
}


.nav a:hover::after {
    width: 100%;
}

/* =========================
   5. KAUPPA – HERO
   (vain omakauppa.php käyttää)
========================= */
.hero {
    background: linear-gradient(135deg, rgb(8, 224, 8), #000200ff);
    color: var(--text-inverse);
    padding: 60px 30px;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
}
.hero h1,
.hero p {
    color: var(--text-inverse);
    border: none;
}

/* =========================
   6. KAUPPA – TUOTTEET
========================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;

}

.product-card {
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #f3f3f3 100%
    );
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow:         
    0 10px 30px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 18px 45px rgba(0,0,0,0.25);
}

.product-image {
    position: relative;
    background: #ddd;
}

.product-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.product-card-body {
    padding: 18px;
}

.product-card-body h3 {
    margin-top: 0;
}

.product-card-body p {
    font-size: 14px;
    color: #555;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

.buy-button {
    width: 100%;
    margin-top: 15px;
}


/* =========================
   ONNISTUMISVIESTI
========================= */
.success {
    background: #e8f5e9;
    border-left: 6px solid #4CAF50;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #256029;
    font-weight: bold;
    border-radius: 6px;
}

.added-inline {
    margin-top: 8px;
    padding: 6px 10px;
    background: #e8f5e9;
    color: #256029;
    font-size: 14px;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
}

/* kassapainike */
.checkout-btn {
    background: #2e7d32;
    font-size: 18px;
}

.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    color: white;
}

.status.uusi {
    background: #1976d2;
}

.status.kasittelyssa {
    background: #f9a825;
}

.status.toimitettu {
    background: #2e7d32;
}

.status.peruttu {
    background: #c62828;
}