/* ====================================== GLOBAL VARIABLES ====================================== */
:root{
    --color-gradient-primary: linear-gradient(#0B2474, #0E2B8B, #091D5D);
    --color-gradient-secondary: linear-gradient(#1236A3, #1541C0, #0B2A84);

    --color-text-primary: #FFF;
    --color-text-secondary: #FFEA00;

    --color-background-primary: #FFF;
    --color-background-secondary: #cfcfcf;

    --color-form: #F7F7F7;

    --color-table-th: #f1f1f1; 

    --color-border-primary: #D2D2D2;
    --color-border-secondary: #7A7A7A;
}



/* ======================================== BASE STYLES ======================================== */
*{ 
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html{
	height: 100%;
    font-size: 16px;
}

body{
	min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main{
    flex: 1;
}

a{
    text-decoration:none;
    color: #000;
}

table{
    border-collapse: collapse;
    width: 100%;
}

tr{
    display: table-row;
}

td, th{
    display: table-cell;
    padding: 15px 0;
}

input{
    border: 1px solid var(--color-border-secondary);
    border-radius: 3px;
    outline: none !important;
    box-shadow: none !important;
    padding: 3px;
}

input.error {
    border: 1px solid red;
}



/* =========================================== LAYOUTS =========================================== */

/* ================ MAIN LAYOUT ================ */
.main-layout{
    flex: 1;
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 0;
    background: var(--color-background-secondary);
}

.wrapper{
    margin: 1rem;
    background: var(--color-background-primary);
    border: 0.05rem solid var(--color-border-primary);
}

.content-title{
    padding: 2rem;
}

.content{    
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    gap: 1rem;
}

.content-header{
    display: flex;
    align-items: center;
    width: 100%;
}

.content-box{
    width: 100%;
}


/* ================ LOGIN LAYOUT ================ */
.login-layout{
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    min-height: 0;
    background: linear-gradient(rgba(0,0,0,0.4)),
                url("../images/login_wallpaper.jpg") center / cover no-repeat;
}


/* ========================================= COMPONENTS ========================================= */

/* ================ NAVBAR ================ */
.nav{
    display: flex;
    align-items: stretch;
    height: 50px; 
    width: 100%;
	background-image: var(--color-gradient-primary);
}

.nav form {
    margin-left: auto;
    margin-right: 20px;
}

.logout-form{
    display: flex;
}


/* ================= LOGO ================= */
.logo{
    padding-left: 10px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
}


/* =============== SIDEBAR =============== */
.sidebar{
   background: var(--color-background-primary);
   border-right: 0.05rem solid var(--color-border-primary);
}

.sidebar ul li a{
    display: block;
    width: 100%;
    padding: 1rem 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.sidebar ul li a:hover{
    background: #F0F6FF;;
}

.sidebar ul li {
    border-bottom: 0.05rem solid var(--color-border-primary);
}


/* =============== FOOTER =============== */
footer{
    width: 100%;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-primary);
	background-image: var(--color-gradient-primary);
}


/* =============== ERROR MESSAGES =============== */
.error-message-box{
    margin: 10px auto 10px auto;
    font-size: 14px;
    text-align: center;
}

#error-message{
    background-color: #FFE5E5;
    color: #B30000;
    min-width: 200px;
    border: 1px solid #FF4D4D;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.error-message-text{
    margin-top: 10px;
}

.error-text-input {
    grid-column: 2;
    display: block;
    color: red;
    font-size: 12px;
}


.error-container{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    background: radial-gradient(circle,  var(--color-background-primary), var(--color-background-secondary), #cacaca );
}

.error-box{
    padding: 5rem 6rem;
    background: var(--color-background-primary);
    border-radius: 20px;
    border: 1px solid var(--color-border-secondary);
    box-shadow: 6px 6px 12px rgba(0,0,0,0.2);
}

.error-box h1 {
    font-size: 120px;
    margin: 0;
    font-weight: 700;
}

.error-box p {
    font-size: 18px;
    margin: 20px 0;
}

.error-box a {
    display: inline-block;
    width:200px;
    margin-top: 15px;
    padding: 10px 20px;
	background-image: linear-gradient(#0b2474, #0e2b8b, #091d5d);
    color:  var(--color-text-primary);
    text-decoration: none;
    font-size: 14px;	
    cursor: pointer;
    font-weight:bold;
    font-style: italic;
    font-family: sans-serif;
    border-radius: 10px;            
}

.error-box a:hover {
	color:#ffea00;
    background-image: linear-gradient(#1236a3, #1541c0, #0b2a84);
}


/* ========================================= BUTTONS ========================================= */

/* =============== FORM BUTTON =============== */
.form-button{
    width:200px;
	height: 2rem;
	text-align: center;
	font-weight: bold;
	font-size: 16px;
	cursor: pointer;
	color: var(--color-text-primary);
	font-style: italic;
	font-family: sans-serif;
	background-image: var(--color-gradient-primary);
    border-radius: 10px;
}

.form-button:hover{
	color: var(--color-text-secondary);
	background-image: var(--color-gradient-secondary);
}



/* =============== LOGOUT BUTTON =============== */
.logout-button {
    display: flex;
    align-items: center;
    height: 100%; 
    padding: 0 10px;
    color: var(--color-text-primary);
    background: none;
    border: none;
    cursor: pointer;

}

.logout-button:hover{
	color:var(--color-text-secondary);
	background-image: var(--color-gradient-secondary);
}


/* =============== CREATE BUTTON =============== */
.create-button{
    margin-left: auto;
    padding: 8px 20px;
    background: #11C950;
    color: var(--color-text-primary);
    border: none;
    font-weight: bold;
    text-decoration: none;
    margin-right: 30px;
}

.create-button::before{
    content: "+";
    margin-right: 10px;
    font-weight: bold;
    font-size: 1rem;
    padding: 0 3px;
    background: #FFF;
    color: #11C950;
    border-radius: 2px;
}

.create-button:hover{
    background:#0FAE45;
}


/* =============== OPERATION BUTTONS =============== */
.col-operations-td button{
    margin: 0 10px;
    padding: 5px 10px;
    width: 100px;
    font-size: 10px;
    font-weight: bold;    
    border: none;
    cursor: pointer;  
    border-radius: 6px; 
    color: var(--color-text-primary);
}

#edit-button{
    background: #FF9910;    
}

#edit-button:hover{
    background: #D38210;
}

#delete-button{
    background: #F11109;
}

#delete-button:hover{
    background: #C02722;
}

#state-button, #permissions-button{
    background: #6C757D;
}

#state-button:hover, #permissions-button:hover{
    background: #50555A;
}

.permissions-form-button{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.permissions-form-button button{
    margin-bottom: 10px;
    width: 300px !important;
}

/* ========================================= TABLES ========================================= */

/* ================ GENERAL STYLES ================ */
.content-box table{
    text-align: center;
}

.content-box thead th{
	background-image: var(--color-gradient-primary);
    color: var(--color-text-primary);
    padding: 10px;
}

.content-box tbody tr:nth-child(even) {
    background: var(--color-table-th);
}


/* ================ OPERATIONS COLUMN ================ */
.col-operations-td{
    width: 25%;
    white-space: nowrap;
    padding-right: 20px !important;
}

.col-operations-td form {
    display: inline-block;
}

/* ================ LABELS ================ */
.allowed{
    background-color: #E6F9F0;
    color: #0F7A4A;
    width: 100%;
    border: 1px solid #33CC80;
    padding: 4px 10px;
    border-radius: 6px;
}

.denied{
    background-color: #FFE5E5;
    color: #B30000;
    width: 100%;
    border: 1px solid #FF4D4D;
    padding: 4px 10px;
    border-radius: 6px;
}


/* ================ USERS TABLE ================ */
.col-id-th{
    width:12%;
}

.col-designation-th{
    width:12%;
}


/* ================ PERMISSIONS TABLE ================ */
.permissions-table{
    margin-bottom: 5rem;
}

.col-permission-th{
    width: 35%;
    text-transform: uppercase;
    text-align: left;
    padding-left: 3rem !important;
}

.col-permission-td{
    text-align: left;
    padding-left: 3rem !important;
}

.col-reference-th{
    width:30%;
}

.col-permission-checkbox-td{
    width: 20%;
}

.permissions-table input[type="checkbox"]{
    width:15px;
    height:15px;
    cursor:pointer;
    accent-color:#2ECC71;
}



/* ======================================= OTHER PAGE STYLE  ========================================= */

/* ================ LOGIN PAGE ================ */
#login-title{
    text-transform: uppercase;
    padding: 10px;
    letter-spacing: 0.3rem;
}

.login-form{
    text-align: center;
}

/* ================ CREATE PAGES ================ */
.form-container{
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    border:1px solid var(--color-border-secondary);
	box-shadow: 5px 5px 7px rgba(255,255,255,0.5);
    min-height: 400px;
    min-width: 450px;
    padding: 30px;
    margin-bottom: 30px;
    background: var(--color-form);
    border-radius: 20px;

}

.form-container h2{
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}


.form-box{
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2px 15px;
    align-items: center;
}

.form-box label{
    text-align: right;
    margin-top: 15px;

}

#create-box h2{
    margin-bottom: 50px;
    text-transform: uppercase;
}

.form-box input{
    width: 100%;
    margin-top: 15px;
}

.form-box button{
    grid-column: span 2;
    justify-self: center;
    margin-top: 10px;
}

.form-box button:first-of-type {
    margin-top: 40px;
}



.form-box select{
    width: 100%;
    margin-top: 15px;
}

.menu li {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #F0F6FF;
    border: 1px solid #ccc;
    min-width: 180px;
    list-style: none;
}

.with-submenu:hover .submenu{
	display:block;
    background: var(--color-background-primary);
    cursor: none;
}

.form-cancel-button{
    width:200px;
	height: 2rem;
	text-align: center;
	font-weight: bold;
	font-size: 16px;
	cursor: pointer;
	font-style: italic;
	font-family: sans-serif;
    background: #e0e0e0;
    color: #000;
    border-radius: 10px;
    border: 2px solid grey;
}

.form-cancel-button:hover{
    background: #c1c0c0;
}